donkirkby / live-py-plugin

Live coding in Python with PyCharm, Emacs, Sublime Text, or even a browser
https://donkirkby.github.io/live-py-plugin
MIT License
290 stars 57 forks source link

Set willReadFrequently attribute of HTML canvas #503

Closed donkirkby closed 1 year ago

donkirkby commented 1 year ago

What I did

Refresh the Matplotlib intro tutorial with Ctrl+F5 and the console window open.

What happened

Saw a warning in the console:

Canvas2D: Multiple readback operations using getImageData are faster with the willReadFrequently attribute set to true. See: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently

donkirkby commented 1 year ago

Timing of Romania tutorial after I made matplotlib optional:

Timing of Matplotlib intro:

Timing of Romania tutorial after I made willReadFrequently true:

Timing of Matplotlib intro:

So there's no significant change to the timing, but the warning went away. I guess I'll keep the change.