Piers Cowburn wrote:
Yeah, I was thinking along those lines. However, it's interesting that in tests
Vector 0a vs Vector 1a, the implicit cast is still faster than using [ ] to
access the reference directly from the vector. You'd think that with the vector
being typed as TestClass, vector[i].someMethod() should be faster than var
reference:TestClass = vector[i]; reference.someMethod()
I think the compiler is still seeing the typed Vector as Vector, not
typed vectors. Consequently a lookup is still involved. The
Vector.<Someclass> declaration seems more of a syntactic convenience
rather than anything else.
That's just guesswork on my part.
Paul
Unless you were then going to use the reference again, in which case storing a
temporary reference will always be faster. But for a one time look up from a
typed vector, I'm surprised that two lines of code executes faster than one. I
was wondering whether there might be something wrong with my test, but I can't
see anything.
Piers
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders