I am thinking about making a website with some fairly intense JavaScript/canvas usage and I have been looking at Processing.js and it seems to me that it would make manipulating the canvas significantly easier. Does anyone know any reasons why I shouldn’t use Processing.js? I understand that older browsers won’t be able to use it, but for now that’s ok.
I am thinking about making a website with some fairly intense JavaScript/canvas usage and
Share
As mentioned, IE is not supported by Processing.js (including IE8 beta). I’ve also found processing.js to be a bit slow in terms of performance, compared to just using canvas (especially if you’re parsing a string with Processing language, instead of using the javascript API).
I personally prefer the canvas API over the processing wrapper, because it gives more me control. For example:
The processing line() function is implemented like this (roughly):
And you’d use it like this (assuming you’re using the javascript-exposed API):
Notice that every line() call has to open and close a new path, whereas with the canvas API you can draw all the lines within a single beginPath/endPath block, improving performance significantly: