Skip to content
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

refactor: get a 45% performance boost #399

Merged
merged 1 commit into from
Dec 12, 2022
Merged

refactor: get a 45% performance boost #399

merged 1 commit into from
Dec 12, 2022

Conversation

connor4312
Copy link
Member

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:

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:

![](https://memes.peet.io/img/22-12-6eab495d-1008-4eee-a9e5-eb90233b723e.png)

after:

![](https://memes.peet.io/img/22-12-0df37399-2450-4631-9b25-e3fb91dccb9c.png)
Copy link
Member

@lramos15 lramos15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 , awesome work!

@connor4312 connor4312 merged commit 6fcb339 into main Dec 12, 2022
@connor4312 connor4312 deleted the more-perf branch December 12, 2022 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants