frappe / datatable

The Missing Javascript Datatable for the Web
https://frappe.io/datatable
MIT License
991 stars 160 forks source link

perf: :rocket: rendering large data #197

Closed ankush closed 5 months ago

ankush commented 5 months ago

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 https://github.com/frappe/frappe/pull/25395

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

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

github-actions[bot] commented 5 months ago

:tada: This PR is included in version 1.17.15 :tada:

The release is available on:

Your semantic-release bot :package::rocket: