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

DataTable: Slow filter and sort performance with large datasets #4007

Closed
andrewguy opened this issue May 31, 2023 · 3 comments · Fixed by #4008
Closed

DataTable: Slow filter and sort performance with large datasets #4007

andrewguy opened this issue May 31, 2023 · 3 comments · Fixed by #4008
Assignees
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@andrewguy
Copy link
Contributor

Describe the bug

Filter and sort performance is slow when dealing with large numbers of filters and/or large datasets with the DataTable component.

This seems to be due to a couple of things:

  • Large numbers of calls to ObjectUtils.resolveFieldData within the compareFn function passed to sort. ObjectUtils.resolveFieldData is relatively slow. Doing an expensive function call within the compareFn means that sort performance scales poorly with dataset size.
  • Executing filters even when the filter value is null, which is performed for each item in the data array. If a filter value is null, this filter is still assessed, which also involves a call to ObjectUtils.resolveFieldData. This means that filters on many columns leads to poor performance when filtering or sorting, even if those filters aren't active.

I'm raising this issue as part of a PR that aims to improve performance for both sort and filter routines in the DataTable component.

Reproducer

https://codesandbox.io/s/priceless-sound-jwo4kl

PrimeVue version

3.29.1

Vue version

3.x

Language

ES6

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@andrewguy andrewguy added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label May 31, 2023
@NeluQi
Copy link

NeluQi commented Jun 9, 2023

+1

@NeluQi
Copy link

NeluQi commented Jun 10, 2023

I am having a memory overflow in ObjectUtils.resolveFieldData. Lines 30000.

There can be many more lines in my project.

Please improve performance.

Lazy loading doesn't suit my case

image

@mertsincan mertsincan added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 17, 2023
@mertsincan mertsincan added this to the 3.32.1 milestone Aug 17, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Aug 17, 2023
@tugcekucukoglu
Copy link
Member

013b126

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants