microsoft / vscode-hexeditor

VS Code Hex Editor
https://marketplace.visualstudio.com/items?itemName=ms-vscode.hexeditor
MIT License
533 stars 89 forks source link

refactor: get a 45% performance boost #399

Closed connor4312 closed 1 year ago

connor4312 commented 1 year ago

Some small weekend tweaks.

This moves data retrieval from data rows into data pages. I noticed a bunch of time was spent negotiating data retrieval inside each <DataRowContents />, so this improves that by making it happen in one (or, if the user is on a boundary, two) places instead of 30+. This net about a 30% boost over the original 'new page' render time.

I also moved the DOM structure to be based on DataPages that are in layers and moved as a group instead of inidivudally. This net an additional 15% improvement over the original 'new page' time.

Cost to render a new page before:

after: