home.KaiRo.at
Bio
weBlog
[arts corner]
[science corner]
Slides
Fotogalerien
Kontakt
Suche
>> www.KaiRo.at
New comment
Name:
Email:
Homepage:
Location:
Calculate:
22 minus 10 equals
Subject:
Entry text:
[quote="Boris"]I haven't profiled this, so take what I say with a bit of a grain of salt. I'm basing a lot of these comments on my own experience a week or so ago with writing a mandelbrot program in JS: 1) You're doing a timeout for each point. While this does keep the UI responsive, it introduces a good bit of overhead. 2) You're doing a separate fillStyle set for each point. This is actually surprisingly expensive, since it involves parsing the color string, calls into cairo, etc. I know that my code got a quite significant speedup when I batched up all the points of one color (or rather I batched up all the points, binned by color) and drew them all after doing a single fillStyle set. If you can do any sort of batching here, even if it's not global over the whole algorithm, it would likely help. 3) You're drawing each point as a separate rect. I discovered that I got a 2x speedup or so when I batched up adjacent points of identical color and drew a single bigger rect to cover them all. Your algorithm is going down vertical strips just like mine was, so I suspect you could get a similar speedup. None of the things above are time spent in the JS engine, by the way, so none of them would be helped by the jit. Given that, I'm pretty impressed that you got a 30% speedup from the jit on the non-object case. I suspect that might be all the win you'll see from the jit on that case, but I could be wrong. I'll try to do some digging to see what's going on with the object-oriented case.[/quote]
I accept and follow
the policy of Home of KaiRo
.
This entry supports
emoji
,
bbCode
, and
some HTML codes
.