News for hackers. Stuff that matters.
Re:Python Patterns - An Optimization Anecdote by nene on Tuesday November 02, 2010 @07:27AM (#1859975)
That's exactly what I was thinking:

* In the first version each time the anonymous function is executed interpreter has to lookup String and from it the fromCharCode method => 2n lookups.

* In the second version the String and fromCharCode have to be lookud up only once => 2 lookups.

Therefore according to slow-lookups-theory the first version should be slower. Except when I measure it, the opposite turns out to be true.

There are no comments on this comment yet.