Which JavaScript graphics library has the best per

2019-02-03 16:27发布

问题:

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:

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.



回答2:

Raphael JavaScript Library

http://raphaeljs.com



回答3:

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



回答4:

Up to now - is used processing.js (javascript canvas implementation of "Processing" language) and/or raphael.js (tiny and handy VML/SVG javascript library).

The performance recomendations depends on task:

  • highly dynamic, complex primitives (or huge amount of it) - canvas (pixels, low-level API)

  • lower amount of primitives, highly scalable, integrated in DOM - SVG/VML (vector, high-level API)



回答5:

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/



回答6:

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



回答7:

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.