Open obiot opened 1 year ago
the current Path2d triangulatePath() method : https://github.com/melonjs/melonJS/blob/bb2c02026eac131c74495b27349621e5fa3fb2fa/src/geometries/path2d.js#L55-L78 does not cache the generated data, forcing melonJS to recalculate every thing when using directly method like fillRect() and friends, and create a huge performance bottleneck.
triangulatePath()
fillRect()
For reference here below is an extract from a benchmark on fill operation for both rectangle and circle:
which shows performances dropping when drawing more than 1'000 shapes per frame.
the current Path2d
triangulatePath()
method : https://github.com/melonjs/melonJS/blob/bb2c02026eac131c74495b27349621e5fa3fb2fa/src/geometries/path2d.js#L55-L78 does not cache the generated data, forcing melonJS to recalculate every thing when using directly method likefillRect()
and friends, and create a huge performance bottleneck.For reference here below is an extract from a benchmark on fill operation for both rectangle and circle:
which shows performances dropping when drawing more than 1'000 shapes per frame.