views:

2060

answers:

6

I'm doing some research for a JavaScript project where the performance of drawing simple primitives (i.e. lines) is by far the top priority.

The answers to this question provide a great list of JS graphics libraries. While I realize that the choice of browser has a greater impact than the library, I'd like to know whether there are any differences between them, before choosing one.

Has anyone done a performance comparison between any of these?

+1  A: 

None of them have good performance. It is 2009 and the state of programmable graphics rendering in web browsers is truly depressing. I could do faster interactivity on a vt125 terminal 25 years ago. If you are doing anything interactive, think about using Flash... Else I'd go for some server-side heavy solution depending on your needs

Scott Evernden
I know that none of them have good performance; I'm looking for which has the least terrible performance. And, although I've used Flash for a ton of other projects, I specifically want to do this in JS.
DNS
yeah i understand. i do. I've spent loads of years doing graphics and I really couldn't imagine doing anything interesting graphics-wise using pure JS. Maybe you are just doing flow-diagrams and it won't be so bad :/
Scott Evernden
+1 for humour and honesty
Jarret Hardie
-1: He didn't ask if they had good performance overall.
Josh Stodola
c'mon -- "javascript graphics" and "performance" really don't belong in the same sentence
Scott Evernden
unless there's a "horrendous" thrown in there somewhere (either place works, really)
cmptrgeekken
+1  A: 

For basic drawing (such as lines, circles, and polygons), I would recommend Walter Zorn's Graphics Library. It was built with performance in mind and works in a ton of browsers.

Josh Stodola
it draws pixels using .... divs . oye
Scott Evernden
Check the performance benchmarks of this library and compare them with other popular ones. Then re-focus on the question, Captain ignorance.
Josh Stodola
one more time cause you are kinda dense .. it draws pixels using .... divs
Scott Evernden
A: 

I know you said browser had more influence, so why not stick with using optimized SVG calls? Then, it "could" work in all browsers but...

Chrome is robust enough to do render 3D modeling efficiently:

http://www.chromeexperiments.com/detail/monster/

altCognito
+1  A: 

If you're not doing 3d, just use raw canvas with excanvas as an explorer fall-back. Your bottleneck will be javascript execution speed, not line rendering speed. Except for IE, which will bog down when the scene gets too complex because VML actually builds a dom.

If you're really worried about performance though, definitely go with flash and write the whole thing in actionscript. You'll get an order of magnitude better performance, and with the flex sdk you don't even need to buy anything. There are several decent libraries for 3d in flash/flex available.

Joeri Sebrechts
Yeah, this seems to be the consensus. Regarding Flash; that's what I usually use, but in this case I specifically want to do this in JS, for the sake of doing it in JS (inspired by Chrome Experiments).
DNS
A: 

How about http://www.jsgl.org? It uses SVG/VML.

Tregoreg
A: 

Raphael JavaScript Library

http://raphaeljs.com

reelfernandes