Subj : Re: JS spead in UI thread? To : Peter Wilson From : Brendan Eich Date : Mon Feb 21 2005 09:55 am Peter Wilson wrote: > Thanks for the reply. > > In converting to run in threaded code I copied the input to a JS > variable - this was the sole cause of the speed up.. The original made > repeated access to a UI text field value. The slowdown was entirely due > to the XBL access overhead. DOM overhead, too, if different. Cross-posting with followup-to: set so DOM folks can comment. > The amended version now runs in the same 0.5 seconds. DOM folks: when repeatedly accessing the text value, the same regexp-using script took 12 seconds, Peter said. > I was unaware that access to UI widget properties was so expensive. > Sorry for the false alarm. Accessing a local variable will always be faster than accessing a DOM text input's value property, but perhaps the latter is too slow. How does your testcase work in other browsers when repeatedly accessing the input's value property? Or rather, what is the ratio of value vs. var time in other browsers? /be .