Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> What's wrong in this case with the very good performance across many platforms (even tablets) of the SVG-backed RaphaelJS?

So I attempted to determine the accuracy of this claim. I ran a benchmark from Kevin Roast [1] who seems to author a lot of Canvas demos. For each of the 8 tests in his benchmark, I recorded the FPS reading that I saw that was the lowest (e.g., framerate dropped to X at some point during the 5-second test).

Mac iPad

20fps 16fps

29fps 18fps

30fps 21fps

30fps 30fps

28fps 6fps

29fps 18fps

29fps 7fps

12fps 30fps

mean_mac = 25.875, median_mac = 29 mean_ipad = 18.25, median_ipad = 18

On the Mac side, I can see both sides of the issue. Arguably 26-29fps in a wide variety of situations is good enough for a wide variety of applications. At the same time, I can understand the author really wanting to blow past 29fps.

On the iPad side, the issue is more clear. I think most people would say that 18fps is unacceptable for a drawing application.

(If these numbers are contributing to the "pseudo-myth" of slow Canvas performance, please point me to a reasonable benchmark. This one is just the most comprehensive one that I found.)

> At the risk of being a bit rude, it's worth noting that he doesn't bother with all Desktops, just Mac, which causes further suspicion that this is really just a rationalization piece and not about performance.

He addresses the choice of the Mac platform in some detail in the "Drawbacks" and "Conclusions" section of the post. At the risk of being a bit rude, it's poor form to dismiss someone's reasoning as a "rationalization" without addressing the reasoning on the merits. To the extent that his choice of Mac over Windows et al is specious, it is not a claim that is supported by your comment.

[1] http://www.kevs3d.co.uk/dev/canvasmark/



In the sentence you quoted I'm referring to SVG, not canvas, and the "in this case" refers to mapping apps, not games. I never made any claims with regards to games.

In the test you quoted the goal is to stress it until it could only handle 30fps (it says so on the page), so you necessarily must see 30fps for the test to go on to the next one. That is why your median score on the Mac is 29fps, because it degrades smoothly on the desktop compared to a mobile device.

If you want to see many devices peg 60fps on the canvas (the rate imposed by requestAnimationFrame), you can use a demo like MS' Fish one.[1] Your Mac ought to get 60fps for 1000 fish on a 1920 x 1075 canvas with no sweat. This is not a very interesting test, and I don't know what it will look like on an iPad, but it more than enough accounts for any animation you might see in a mapping application.

[1] http://ie.microsoft.com/testdrive/performance/fishietank/


“Your Mac ought to get 60fps for 1000 fish on a 1920 x 1075 canvas with no sweat.”

I just checked, and indeed, my new MacBook Air with external display ran it just fine at 60fps. My 3 year old Mac mini handled 45fps. My iPad 4 managed to crank out 25fps in a 981x644 window.


Can you recommend any resources for writing performant code for canvas / SVG?


wow, thanks for the link.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: