Live data from Hacker News

HTML 5 canvas graphics library

exsprite.com

1–10 of 19 posts

Re: HTML 5 canvas graphics library

#2
I'm always glad to see more canvas libraries, but the performance of this one is pretty horrendous. I'm writing a comprehensive canvas diagramming library that is now up to 70K lines and its no where near this slow.

In case the author reads these comments I'll mention a few I see at first glance:

They are doing things like setting the font every on single draw unnecessarily (which takes a surprising amount of time, performance-wise). Actually they are resetting nearly all of the canvas state by hand on each draw, which can just as easily be done in the much faster way by doing "canvas.width = canvas.width". But even that they shouldn't do if they can avoid it.

Similarly the author should not set the globalCompositeOperation all the time unless he or she really needs to.

I'm sure there are a lot of other low-hanging fruit that can be fixed. I'll try send the author an email later tonight. I hope they keep at it.

Re: HTML 5 canvas graphics library

#3

I'm always glad to see more canvas libraries, but the performance of this one is pretty horrendous. I'm writing a comprehensive canvas diagramming library that is now up to 70K lines and its no where near this slow. In case the author reads these comments I'll mention a few I see at first glance: They are doing things like setting the font every on single draw unnecessarily (which takes a surprising amount of time, p…

I agree, I watched the demos and thought it had horrible performance.

Did you say your library had 70K lines!?!!?

Re: HTML 5 canvas graphics library

#4

I'm always glad to see more canvas libraries, but the performance of this one is pretty horrendous. I'm writing a comprehensive canvas diagramming library that is now up to 70K lines and its no where near this slow. In case the author reads these comments I'll mention a few I see at first glance: They are doing things like setting the font every on single draw unnecessarily (which takes a surprising amount of time, p…

Where are you getting your canvas performance info from? I'm building a canvas library too (http://jeremyckahn.github.com/rekapi/), I'd love to learn more.

Re: HTML 5 canvas graphics library

#5

I'm always glad to see more canvas libraries, but the performance of this one is pretty horrendous. I'm writing a comprehensive canvas diagramming library that is now up to 70K lines and its no where near this slow. In case the author reads these comments I'll mention a few I see at first glance: They are doing things like setting the font every on single draw unnecessarily (which takes a surprising amount of time, p…

I'm also kind of sick of seeing stuff done with canvases that could probably be done as efficiently or more efficiently without. (It would be particularly cool for someone to implement a library that abstracted out the back-end, so you could run in DHTML4 or excanvas or a real canvas.)

Re: HTML 5 canvas graphics library

#7

I'm always glad to see more canvas libraries, but the performance of this one is pretty horrendous. I'm writing a comprehensive canvas diagramming library that is now up to 70K lines and its no where near this slow. In case the author reads these comments I'll mention a few I see at first glance: They are doing things like setting the font every on single draw unnecessarily (which takes a surprising amount of time, p…

I'm also kind of sick of seeing stuff done with canvases that could probably be done as efficiently or more efficiently without. (It would be particularly cool for someone to implement a library that abstracted out the back-end, so you could run in DHTML4 or excanvas or a real canvas.)

Shameless plug redux... My library does exactly that, as linked in another response: http://jeremyckahn.github.com/rekapi/

Re: HTML 5 canvas graphics library

#9
Cool...other than the parts that need click or keyboard input, all the demos seem to work, more or less, on my iPhone 4S (Canvas Creatures is pretty sluggish, though) and Kindle Fire (both Canvas Creatures and Snake are sluggish there, and Canvas Creatures looks a little weird, like the maybe the alpha channel isn't quite working. This may be a limitation of the Kindle display or browser; I haven't had it long enough to judge).

How about adding support for touch events and gestures? :-)

Post reply on HN