Subj : Re: JS spead in UI thread? To : Peter Wilson From : Brendan Eich Date : Sun Feb 20 2005 01:09 pm Peter Wilson wrote: > In Firefox, I am writing a JS tokenizer using repeated regexp calls. The > original version took twelve seconds to tokenize a 14k file. Given this > pathetic speed I almost gave up. > > Just to see how threading worked, I tried executing the same code in a > separate thread. The code now executes in less than 0.5 seconds. > > What causes the huge slowdown on the main UI thread? Without making your code and 14k input file available for study, or at least your providing some profiling data, who knows? http://lxr.mozilla.org/mozilla/source/js/narcissus/ contains a JS implementation written in (slightly extended) JS, which uses regexps for scanning. It would be interesting to run on that 14k input file. /be .