4 ms·
> Did you know that in Firefox a switch statement is one hundred times faster than an object lookup? A switch statement in what language? I presume by "object
by wingo 16y ago
> Did you know that in Firefox a switch statement is one hundred times faster than an object lookup?
A switch statement in what language? I presume by "object lookup" you mean the "bar" in "foo.bar" in javascript.
With all respect, I think you are worrying too much :)
- WilliamLP 16y ago> A switch statement in what language? Javascript. > I presume by "object lookup" you mean the "bar" in "foo.bar" in javascript. Yes, but more specifically what I tested was the foo[bar] form, where bar contains a string, versus switch(bar). > With all respect, I think you are worrying too much :) For a language that is supposed to be nearly ready for writing rich interactive applications including pixel-by-pixel manipulation, two orders of magnitude (and widely variable across browsers) is a huge deal. I'm guessing you haven't tried to do much canvas programming?