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

perf: 🚀 rendering large data #197

Merged
merged 1 commit into from
Mar 13, 2024
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Mar 13, 2024

visibleRowIndices.includes is major culprit in rendering data table.
This is because for every row it does this computation, so instead of
O(N) operation it becomes O(N^2)

image

refer frappe/frappe#25395

Rows Before After
1000 0.29 0.3
10,000 0.39 0.344
100,000 4.8 1.05
1,000,000 💀 11.14

Now most slowdown is from this copying: https://github.com/ankush/datatable/blob/4f5b2422ec893bbfc98b75d2a3037ae3a3e0b204/src/datamanager.js#L213-L215

visibleRowIndices.includes is major culprit in rendering data table.
This is because for every row it does this computation, so instead of
O(N) operation it becomes O(N^2)
@ankush ankush changed the title perf: rendering large data perf: 🚀 rendering large data Mar 13, 2024
@ankush ankush merged commit bed2708 into frappe:master Mar 13, 2024
1 check passed
@ankush ankush deleted the perf_include branch March 13, 2024 12:11
Copy link

🎉 This PR is included in version 1.17.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant