Generic asn.1 parser

Raimo Niskanen raimo@REDACTED
Thu Apr 12 10:22:27 CEST 2001


Sean Hinde wrote:
> 
> > On Wed, 11 Apr 2001, Sean Hinde wrote:
> >
> > >I use atoms quite a bit - does anyone have a good feel for the
> > >performance impact of this over using integers for matching and
> > >tagging?
> >
> > There should be no performance difference.
> 
> But doesn't it do some form of lookup in the atom table?
> 

Internally, atoms are tagged integers. This means that comparisions for
equality and pattern matches are just as simple as for integers.
Construction of an atom, however, results in an insertion into the atom
table, which is some kind of fast hash table. 

Compiled atoms are inserted in the atom table sometime when the code is
loaded, thus possibly affecting the load time, marginally. What may be a
catch is to construct atoms on the fly, and to construct an infinite
number of them (due to random runtime data). This way you can exhaust
the atom table since atoms are never removed therefrom.

/ Raimo Niskanen, Ericsson UAB, Erlang/OTP



> Sean
> 
> NOTICE AND DISCLAIMER:
> This email (including attachments) is confidential.  If you have received
> this email in error please notify the sender immediately and delete this
> email from your system without copying or disseminating it or placing any
> reliance upon its contents.  We cannot accept liability for any breaches of
> confidence arising through use of email.  Any opinions expressed in this
> email (including attachments) are those of the author and do not necessarily
> reflect our opinions.  We will not accept responsibility for any commitments
> made by our employees outside the scope of our business.  We do not warrant
> the accuracy or completeness of such information.



More information about the erlang-questions mailing list