Re:JavaScript Performance MythBusters (via jsPerf)
by jdd on Saturday March 17, 2012 @02:52PM
(#3717821)
The point of this test is to show that you should avoid making blanket assumptions about performance and that you shouldn't fear the RegExp :)
You can see my full reply here: http://jsperf.com/regexp-indexof-perf#comment-3
Re:JavaScript Performance MythBusters (via jsPerf)
by WayneDB on Saturday March 17, 2012 @05:37PM
(#3718292)
You're still testing concat + indexOf, not just indexOf. I think that test is broken.
Re:JavaScript Performance MythBusters (via jsPerf)
by jdd on Saturday March 17, 2012 @06:34PM
(#3718428)
The test isn't broken in the scope of its use case. You are totally missing the point which is RegExp's are no longer a guaranteed fail when it comes to performance and that in many situations, including that jsPerf test, can out perform the indexOf equivalent.
Please correct me if I'm wrong.
The test I'm talking about: http://jsperf.com/regexp-indexof-perf