I haven't got to performance yet, but Alex (from Dojo) suggested
creating synthetic events to measure this. What's interesting is the
number of event dispatches per second you can get on different
browsers. I've never worked with synthetic events, but I think it
goes something like this:
function mousemove(e)
{
e = fix(e);
var xpos = e.pageX; // or e.posx(), etc
return;
}
var start = (new Date).getTime();
for (var i = 0; i < 1000; i++) {
// do the synthetic event dispatch
}
var time = (new Date).getTime() - start;
// figure out how many events/second you can do
If you (or someone) has time, please try building the test harness
and then post it to the list. I think at n = 100000, you should start
to see the events show up in a memory profiler as well.
On 18-Jan-06, at 1:17 PM, Ian MacLeod wrote:
I would like to see your results of this. I'd be curious to see
how much overhead calling a function is as opposed to just running
a block of quick comparisons as I do. If you have time, you might
want to take a look at memory overhead as well (and make sure you
set up a prototyped object to cut down on function duplication. If
only we could explicitely pass those by reference...)