OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: String interning (WAS: SAX2/Java: Towards a final form)

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <david@megginson.com>
  • To: xml-dev-digest@ic.ac.uk
  • Date: 17 Jan 2000 21:17:53 -0500

Tyler Baker <tyler@infinet.com> writes:

> As you can see an identity test is done right off the bat so if you make a call like this:
> 
> if (foo.equals("x")) {
> 
> }
> 
> And foo == "x", then your only additional overhead to a straight identity test is the
> dynamic method invocation of String.equals().

Only if the strings are equal -- if you're in a long switch statement, 
most of them won't be equal, and the overhead will be much more than
the function call.


All the best,


David

-- 
David Megginson                 david@megginson.com
           http://www.megginson.com/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ or CD-ROM/ISBN 981-02-3594-1
Please note: New list subscriptions now closed in preparation for transfer to OASIS.






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS