You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does the latest version of Prism from the download page also have this issue? I'm using it from npm.
Description
The line-highlight plugin is causing multiple forced reflows every time I resize a page. I have about 29 highlighted code blocks on the page. You can see this and the warning here:
Looking at the code, there is a lot of repeated read layout and write layout loops around here:
This is in a for-loop for each highlighted range, which is in another for loop for each code block.
Could this be changed to read the layout all at once and write the layout all at once? If interested, I will submit a PR for this. Here's an example that shows the difference (500ms to 5ms) if batched read/writes are used.
Thanks!
The text was updated successfully, but these errors were encountered:
Information:
1.16.0
.Does the latest version of Prism from the download page also have this issue? I'm using it from
npm
.Description
The line-highlight plugin is causing multiple forced reflows every time I resize a page. I have about 29 highlighted code blocks on the page. You can see this and the warning here:
Looking at the code, there is a lot of repeated read layout and write layout loops around here:
prism/plugins/line-highlight/prism-line-highlight.js
Line 70 in d2089d8
This is in a for-loop for each highlighted range, which is in another for loop for each code block.
Could this be changed to read the layout all at once and write the layout all at once? If interested, I will submit a PR for this. Here's an example that shows the difference (500ms to 5ms) if batched read/writes are used.
Thanks!
The text was updated successfully, but these errors were encountered: