Canvas strokeRect vs rect and then stroke performance

时间:2018-01-23 19:21:52

标签: javascript html canvas

I'm drawing about 80-100 rectangles on a very big canvas.

What's the best way to go about this?

The 2 solutions I have are using strokeRect() inside a for loop OR using beginPath() before the loop, rect() inside it and stroke() after it's done.

Obviously they both work, but is there one that performs better than the other?

0 个答案:

没有答案