Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which JavaScript graphics library has the best performance?

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?

like image 886
DNS Avatar asked Mar 23 '09 23:03

DNS


2 Answers

Updated answer (2019):

The core advice is still the same: for maximal performance use thin wrappers or use raw browser API's, and also avoid the DOM or any DOM-like structure. In 2019 this means avoiding SVG (and any library built on top of it) because it may cause performance issues when trying to rapidly change the DOM.

Canvas is the go-to solution for high performance web graphics, both for the 2d and 3d (webgl) contexts. Flash is dead so no longer an option, but even if it weren't its performance was eventually matched by the native browser API's.

Original answer (2009):

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.

like image 169
Joeri Sebrechts Avatar answered Sep 29 '22 08:09

Joeri Sebrechts


Raphael JavaScript Library

http://raphaeljs.com

like image 36
reelfernandes Avatar answered Sep 29 '22 09:09

reelfernandes