Which would take less processing power, drawing many vector images rapidly? Or drawing a bitmap repeatedly?

83 Views Asked by At

Hello I am using liquidfun.js to simulate a particle system. I am drawing the system using an html5 canvas. The simulation becomes laggy well below the 34k particles that the google engineers say that they get. Mines becomes a slideshow at around 4k.

Currently I draw the particles using

context.arc((particles[k] * mToPx) + offsetX, (particles[k+1] * mToPx) + offsetY, 9.5 , 0, 2*Math.PI );

for every particle in the system.

Would something like

context.drawImage(img,(particles[k] * mToPx) + offsetX, (particles[k+1] * mToPx));

be more efficient?

Is there a way to measure efficiency besides adding particles and looking for lag?

0

There are 0 best solutions below