I was playing around with this file this morning and noticed that the latency was really bad in Firefox 5 and 8. I narrowed it down to the time need to create a bunch of regular expressions. Will attach a testcase. Here are the times:
Firefox 8: 1450ms
WebKit Nightly: 150ms
Chrome 12: 20ms
Since we're sharing a regex implementation with WebKit, I am puzzled by the disparity here. Perhaps we are eagerly compiling each regex and they are doing so lazily. I ruled out network traffic by placing timers directly in the source (attached test is different, so as not to perturb the original file).
Created attachment 546343 [details]
Created attachment 546344 [details]
Created attachment 546345 [details]
Source repo is here:
Poking around twitter.com, I see that this file does get used, albeit an earlier version with fewer regexes to run.
(Also CCing oliver@apple in case he wants to file a bug on JSC being an order of magnitude slower than V8 here)
Here's a patch that speeds up the load in all browsers, in the WebKit bug Oliver points out that I didn't Shark it yet so it could be something else.
The issue was a really long regex. They fixed it on another branch by using character ranges instead.
er, that should be
Making the dependency more specific. Note the reduction in bug 673188 comment 35.
HTML test case shows 9ms in nightlies for me.