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

IGX Datagrid autosize feature with performance improvements #10205

Closed
BotanicalGarden opened this issue Sep 28, 2021 · 4 comments · Fixed by #11267
Closed

IGX Datagrid autosize feature with performance improvements #10205

BotanicalGarden opened this issue Sep 28, 2021 · 4 comments · Fixed by #11267
Assignees
Labels
grid: column-resizing grid: performance grid: resizing 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.

Comments

@BotanicalGarden
Copy link

BotanicalGarden commented Sep 28, 2021

Is your feature request related to a problem? Please describe.

We are using IGX Grid in Angular with numerous rows and columns. Our grids are required to have all columns autosized once data is loaded. We do this by manually calling column.autosize and notice that is a performance bottleneck, sometimes taking up to 2.5 seconds to complete for a particularly large datagrid. This frustrates the user, especially when there are numerous datagrids being displayed and autosized.

Describe the solution you'd like

We'd like:

  1. A feature that automatically has the datagrid columns autosized when data is loaded. E.g. @Input autosize: boolean on the igx-grid component.
  2. We require the autosize to be fairly quick and unnoticeable to the user.

Describe alternatives you've considered

We have made our own performance improvements on the IGX datagrid by avoiding datagrid.reflow() from being called until all columns have been resized. Please see our stackblitz example to compare the old way to our new way:
https://stackblitz.com/edit/github-jxvrgd-9sbr3f?file=src/app/grid/grid-resizing-sample/grid-resizing-sample.component.ts
We'd like this performance to be further improved. We've found that the main bottleneck is happening in the column.getAutoSize() method.

Additional context

Product Details
COMPONENT / igx-grid
PLATFORM / Angular
BUILD NUMBER / 10.2.24

@github-actions
Copy link

github-actions bot commented Jan 8, 2022

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Jan 8, 2022
@ChronosSF ChronosSF removed the status: inactive Used to stale issues and pull requests label Jan 10, 2022
@github-actions
Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label Mar 12, 2022
@dkamburov dkamburov removed the status: inactive Used to stale issues and pull requests label Mar 14, 2022
@MayaKirova
Copy link
Contributor

@BotanicalGarden

We will look into possible ways to improve the performance, however to ensure we are correctly addressing your issue I’d like to ask some additional questions on your scenario.

When checking with our latest version 13.1.1 with the an updated version of your sample: https://stackblitz.com/edit/angular-zz2ek7

I’ve noticed in the performance profile that the actual measuring of the sizes is much smaller than the grid reflow call.
The reflow seem to take 52ms out of the total 74ms it took to resize all columns:

image

While the getAutoSize call seem to be around 4-5ms per column.

Could you perhaps share a sample where it takes 2 seconds for the operation so that we can take a look at that particular scenario? Perhaps there’s some other bottleneck that we’re not aware of or we may have some other ideas on how to improve the performance in that scenario.

In the latest versions there’s probably no need to call he grid reflow explicitly as the width setter already marks the grid for size recalculations on the next detection cycle, so you could skip it from your improved version of the resizing.
It should behave the same and for that particular sample it took 0.014 seconds to complete the operation.
Let me know if perhaps skipping the reflow as a whole resolved the performance issue you have in your larger grids.

@dkamburov dkamburov added 🛠️ status: in-development Issues and PRs with active development on them and removed 🆕 status: new labels Mar 23, 2022
@github-actions
Copy link

There has been no recent activity and this issue has been marked inactive.

@github-actions github-actions bot added the status: inactive Used to stale issues and pull requests label May 23, 2022
@dkamburov dkamburov removed the status: inactive Used to stale issues and pull requests label May 23, 2022
@dkamburov dkamburov added ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged. and removed 🛠️ status: in-development Issues and PRs with active development on them labels Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grid: column-resizing grid: performance grid: resizing 🧰 feature-request ✅ status: resolved Applies to issues that have pending PRs resolving them, or PRs that have already merged.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants