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:


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

Merrill, Jason wrote:
OK good to know, thanks!

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-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kenneth Kawamoto
Sent: Monday, July 21, 2008 12:52 PM
To: Flash Coders List
Subject: Re: [Flashcoders] E4X filtering strange behaviour

Yes that's that :)

Anyway in your case you know the incoming XML schema so you shouldn't use wildcard "*" - I think wildcards have serious performance hits.

i.e. "theXML.topics.topic." should be used rather than "theXML..*."

Kenneth Kawamoto

Merrill, Jason wrote:
Ah, I know where the confusion came from, you said the code
was based
on my example, but that was actually Wagner's example, where he put

var test:XML = <data>...etc.

(it was based on my example, but he used "test" as an
instance of the
XML when requoting my original question) The use of "test"
as the XML
name threw me, because it was mixed in with the regex
method, "re.test"
- I never realized you meant "test" as the XML not test as
some regex
method I wasn't aware of.  So when you wrote

var xmlListSearch:XMLList =
test..*.(re["test"](attribute("*")) || re["test"](child("*")));
You meant

var xmlListSearch:XMLList =
theXML..*.(re["test"](attribute("*")) ||

Got it, I'll give it a shot, thanks.
Flashcoders mailing list

Reply via email to