I'm working on a small video game which includes a drawing loop and I experienced a strange behavior with MS Edge (but it happens in an other way on Chrome too).
At one particular time, I want to get data about pixels and use, just one time, ctx.getImageData()
It triggers a CPU memory increase at this very precise moment (I know this function is costly)... But during all next iterations of the loop, the painting time dramatically increase.
Here is the link: http://millgraphik.alwaysdata.net/cpu-test/
And the code: http://millgraphik.alwaysdata.net/cpu-test/js/canvas.js
You can test with MS Edge, launch the performance record just after page load. The getImageData is triggered at about 3 seconds after page load. Here is the result of performance test:
in green, the painting duration
So what could be the reason of this increasing painting time?

