Live data from Hacker News

Canvas vs SVG performance on iPad

techblog.floorplanner.com

11–15 of 15 posts

Re: Canvas vs SVG performance on iPad

#11
post #9

Earlier quoted context omitted.

The point of a settimeout or setinterval is that it will always process in the next run loop. I don't see how postMessage actually provides anything over calling a function directly.

When I update to setZeroTimeout in those canvas vs svg demos, the drawing is so fast there is horizontal tearing and the frame rates are in the thousands. Which means the FPS with setInterval is actually measuring how long it takes setInterval to fire, not how long it's taking to draw under the different methods.

Very interesting. Do you think it will make a difference on mobile devices?

Re: Canvas vs SVG performance on iPad

#12
post #9

Earlier quoted context omitted.

The point of a settimeout or setinterval is that it will always process in the next run loop. I don't see how postMessage actually provides anything over calling a function directly.

When I update to setZeroTimeout in those canvas vs svg demos, the drawing is so fast there is horizontal tearing and the frame rates are in the thousands. Which means the FPS with setInterval is actually measuring how long it takes setInterval to fire, not how long it's taking to draw under the different methods.

But that's a feature you don't really want. You're blowing away your cpu on something that can only display 60 times a second.

Re: Canvas vs SVG performance on iPad

#13
post #5

I don't think these test results are anywhere close to accurate. Why is the iPhone 4, which has better specs than the iPad 1, 3x slower in the Canvas test? What OS was used on each device? How many test runs were done, and what was the variation like in each?

this might help answer part of your query (from the comments)-

Timothy Fitz Says: March 8th, 2011 at 6:38 pm The iPhone 3GS almost always ends up being the fastest of the iPhones. While the iPhone 4 has a faster CPU, they both have the same GPU (PowerVR SGX 535). While the iPhone 4 has twice the ram (which is fully addressable by the GPU), and could have a faster CPU clockspeed (I couldn’t find reliable sources), at the end of the day the iPhone 4 needs 4 times the fill rate to meet the increased resolution of the retina display, and it doesn’t have even close to 4x the fill rate of the 3GS.

Re: Canvas vs SVG performance on iPad

#15
post #9

Earlier quoted context omitted.

When I update to setZeroTimeout in those canvas vs svg demos, the drawing is so fast there is horizontal tearing and the frame rates are in the thousands. Which means the FPS with setInterval is actually measuring how long it takes setInterval to fire, not how long it's taking to draw under the different methods.

But that's a feature you don't really want. You're blowing away your cpu on something that can only display 60 times a second.

The code in question is a benchmark of how fast two different render APIs work. The only way to do that reliably is to take the question of the timer firing rate out of the equation. I doubt you'd use setZeroTimeout in most realworld environments.
Post reply on HN