I was told on Flexcoders that using @string instead of
attribute("string") can be problematic because an error will result if
the attribute is missing in the node of the XML.  Using attribute()
won't throw any errors if the attribute is missing in the XML node, and
in most cases (depending on what you're doing) is prefereable to @. 

Jason Merrill 
Bank of America 
Enterprise Technology & Global Risk L&LD 
Instructional Technology & Media

Join the Bank of America Flash Platform Developer Community 

Are you a Bank of America associate interested in innovative learning
ideas and technologies?
Check out our internal  GT&O Innovative Learning Blog & subscribe. 


>>-----Original Message-----
>>[mailto:[EMAIL PROTECTED] On Behalf Of Keith
>>Sent: Monday, July 21, 2008 8:19 PM
>>To: Flash Coders List
>>Subject: Re: [Flashcoders] E4X filtering strange behaviour
>>Thanks for showing these results.
>>I'm not missing the "attribute" method that much...and after 
>>this I don't feel any guilt for it. :)
>>-- Keith H --
>>Kenneth Kawamoto wrote:
>>> I just run a quick and dirty test, and I think I can confirm that.
>>> The following test for 10,000 times each:
>>> testXML..*.( re["test"](attribute("title"))); testXML..topic.( 
>>> re["test"](attribute("title"))); testXML.topics.topic.( 
>>> re["test"](attribute("title"))); testXML.topics.topic.( 
>>> re["test"](@title)); testXML.topics.topic.((re as 
>>> RegExp).test(@title));
>>> The result:
>>> 1114ms
>>> 1047ms
>>> 993ms
>>> 868ms
>>> 1087ms
>>> So the wildcard "*" is indeed slower, which is logical. But also 
>>> "attribute()" is slower than "@", moreover "(re as 
>>RegExp).test()" is 
>>> slower than "re["test"]()" - well they are all logical too, you may 
>>> say :)
>>> Kenneth Kawamoto
>>> http://www.materiaprima.co.uk/
>>Flashcoders mailing list
Flashcoders mailing list

Reply via email to