-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forEachCodeMirror is heavy when window resize on plenty of CodeMirror instance #5653
Comments
Attached patch should help a lot with this (by batching the updates to avoid all those relayouts) |
After tested with the patch, the performance is improved, but still have noticeable lag. Can it be better for below?
Just a note for this issue, priority is very low.... |
This is more or less how CodeMirror 6 will work, but for 5 it's unlikely that visibility tracking will be added. |
When there're plenty of CodeMirror instance in a document then
window resize
event will trigger below line:https://github.com/codemirror/CodeMirror/blob/87702cf2eb53cabd25e4f994354ea9fc9e2c1d97/src/edit/global_events.js#L29
That is a heavy operation like the demo below (with 150+ CodeMirror cells):
The chrome performance panel shows this:
Here you can compare with just 5 CodeMirror cells:
Recommended to use some way to distribute the resize into frames like using below:
https://github.com/GoogleChromeLabs/idlize
The text was updated successfully, but these errors were encountered: