News for hackers. Stuff that matters.
Re:Canvas vs SVG performance on iPad by seanalltogether on Tuesday March 08, 2011 @11:22AM (#2301429)
Painting a single rectangle against a timer resolution of 1 millisecond (which the browser won't even do) pretty much tells you nothing.
Re:Canvas vs SVG performance on iPad by Dav3xor on Tuesday March 08, 2011 @01:08PM (#2301888)
Yes, exactly. I have a little web game that renders in SVG, and it puts up ~8000 shapes on the screen, updates at about 5hz on most desktop machines. This is ok, since it's basically a panning map that doesn't get panned much. If I switched to Canvas, it'd run quite quickly, but I'd lose all the wins from using the DOM.
Re:Canvas vs SVG performance on iPad by patr1ck on Tuesday March 08, 2011 @11:45AM (#2301526)
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?
Re:Canvas vs SVG performance on iPad by threepointone on Tuesday March 08, 2011 @09:25PM (#2303527)
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 by ck2 on Tuesday March 08, 2011 @12:04PM (#2301605)
I believe this test proves little useful across different browsers on different OS/hardware because setInterval and setTimeout cannot fire faster than 8-10ms on most browsers and every browser handles a "1ms" request differently.

http://dbaron.org/log/20100309-faster-timeouts

However the postMessage trick is near realtime:

http://dbaron.org/mozilla/zero-timeout

Re:Canvas vs SVG performance on iPad by seanalltogether on Tuesday March 08, 2011 @01:01PM (#2301861)
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.
Re:Canvas vs SVG performance on iPad by ck2 on Tuesday March 08, 2011 @01:15PM (#2301920)
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.

Re:Canvas vs SVG performance on iPad by seanalltogether on Tuesday March 08, 2011 @03:41PM (#2302515)
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 by ck2 on Wednesday March 09, 2011 @10:48AM (#2305169)
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.
Re:Canvas vs SVG performance on iPad by hertog on Tuesday March 08, 2011 @03:07PM (#2302396)
Very interesting. Do you think it will make a difference on mobile devices?
Re:Canvas vs SVG performance on iPad by extension on Tuesday March 08, 2011 @11:41AM (#2301501)
Somehow I doubt that SVG is being completely repainted every time its coordinates change. And since the repaints are asynchronous, I don't see how you could time them from within JavaScript.
Re:Canvas vs SVG performance on iPad by hertog on Tuesday March 08, 2011 @03:02PM (#2302378)
I guess that not repainting everything can be an advantage of SVG. Can you think of a way to time repaints better?
Re:Canvas vs SVG performance on iPad by reirob on Tuesday March 08, 2011 @11:32AM (#2301468)
I did not know that Android does not support SVG. What's the reason?
Re:Canvas vs SVG performance on iPad by th0ma5 on Wednesday March 09, 2011 @12:03AM (#2303892)
it is my understanding that it is coming in honeycomb, i saw a bug report i think about it just last week that was then several months old