New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Performance issues on Safari, Mobile Safari, and Android browsers #66
Comments
Oh ... fyi in case you are interested: the 2D molecular dynamics system: https://github.com/concord-consortium/lab |
Thanks for the comprehensive tests @stepheneb ! The 2D molecular dynamics system is ace! With regards to your findings, they do make sense I think. There is 1 major difference between kinect.js and pixi.js that is causing the discrepancies. Kinect.js is SVG based and pixi.js is image based. The circle in the pixiDemo is being drawn to canvas using Based on your findings, its clear some browsers draw primitives faster than they draw images in canvas. I guess it comes down to what you are creating, if vector shapes are required its worth looking in to SVG/Primitive drawing based solutions (eg Kinect.js) If you are creating more image based creations then bitmap based renderers are the best way to go (eg pixi.js) cheers! |
At 1:14 AM -0700 4/11/13, Mat Groves wrote:
You may be mixing up the D3.js framework which is deeply integrated with SVG and http://kineticjs.com/ which describes itself In the red-circle benchmark test for Canvas (KineticJS) + Shape Caching we are rendering into an HTML5 Canvas element: So while it's also true and surprising that SVG performance is faster on the iPad than Canvas performance -- I was very I took a closer look at Piotr's red-circle benchmarks for KineticJS and Pixi.js. I just looked at the KineticJS source and it is using context.arc() to draw circles to a canvas. While for Pixi.js he is creating a red circle in a separate canvas and using PIXI.Texture.fromCanvas() to create a texture So the slowdown on the iPad seems to be in how you are rendering your PIXI.Texture objects. I wrote a heatmap canvas renderer as part of a research spike in JS performance for a hard-coded adaptation of a model http://stepheneb.github.io/avalanche2d-js/avalanche2d.html This runs quite fast on an iPad. Table of benchmark results: And the canvas rendering code (if it is useful): Pixi.js of course are solving a more general problem, but my heatmap rendering code shows that the problem isn't a performance So I wonder if there still might not be a way to speed up Pixi.js on an iPad. It's on my list to look at this because I'd like to think more about using Pixi.js ... but many things are on my list and Note: I use 'iPad' when I actually mean Safari, Mobile Safari, and the Android browsers because the right now theiPadis the
|
Doh! yup you are correct :) Its quite interesting really! It must be just down to specific browser implementations of JS maybe? Interestingly I just tried the tests on my ipad 2 Safari and got: Pixi.js : circles fps repaint kinect.js: circles fps repaint |
considering this closed, reopen if there is still an issue that needs to be addressed. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
We've implemented an open source HTML5 2D Molecular Dynamics simulation framework and are using SVG and D3.js to render the particles.
Performance is reasonable but there has recently been a terrible SVG performance regression in Firefox.
So we wrote a simple benchmark test to help us evaluate Pixi.js, KineticJS) + Shape Caching, and SVG using D3.js
The results were very confusing ... I'm sharing this here because I thought you would be interested ... in general Pixi.js is very good ...but also there seems to serious relative performance issues on Safari, Mobile Safari, and Android browsers.
Here are the three versions of the benchmark test:
http://bl.ocks.org/pjanik/5169968
SVG (D3, requestAnimationFrame)
http://bl.ocks.org/pjanik/5169961
Canvas (KineticJS) + Shape Caching
http://bl.ocks.org/pjanik/5238284
Pixi.js CanvasRenderer
Anyway here's the very confusing "executive summary" ... following this are the data I collected if you want to dig deeper.
I've collected performance data from three of Piotr's red-circle animation benchmarks from iPad, Android, Mac OS X 10.6.8, 10.8.3, and Windows 7.
Tested on all platforms:
The results are bizarre.
The only consistent results are where WebGL is available Pixi.js WebglRenderer is the fastest by far.
On all the Safari-based browsers (including Mobile Safari on the iPad) the D3 SVG rendering is faster.
Chrome on Android was recently updated from v18 to v25. Chrome v25 now appears to be at least three times slower rendering SVG than Chrome 18.
The stock Android browser is 3x faster rendering SVG than Chrome 25.
On all versions of Safari the Pixi.js Canvas renderer is much slower than than Canvas KineticJS + Shape Caching.
On all the other browsers the Pixi.js Canvas renderer is much faster than Canvas KineticJS + Shape Caching.
EXCEPT on the stock Android browser where the Pixi.js Canvas renderer is 4x slower than Canvas KineticJS + Shape Caching.
On all versions of Firefox Pixi.js CanvasRenderer is much faster than Canvas KineticJS + Shape Caching which in turn is much faster than D3 SVG request AnimationFrame.
On all versions of Chromw (except on Android) Pixi.js CanvasRenderer is about twice as fast as either Canvas KineticJS + Shape Caching or D3 SVG request AnimationFrame (which are about the same).
The text was updated successfully, but these errors were encountered: