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(resizer): autosizeColumns is called too many times on page load #1148

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

ghiscoding
Copy link
Owner

  • when loading a new grid, we are calling grid.autosizeColumns() to resize the columns and while adding tests for that method I incidently discovered that it was being called multiple times on a page load (up to 6-8x times) but in reality there is no need to call it more than once or twice.
  • there is also no need to call the autosizeColumns if the grid dimension calculated by the Resizer Service are the same as the previously calculated dimensions
  • the updated code will never call autosizeColumns more than twice on a page load, however note that the method will always be called whenever the grid dimensions or columns get updated

Copy link

codecov bot commented Jan 18, 2024

Codecov Report

Attention: 12 lines in your changes are missing coverage. Please review.

Comparison is base (8b418f2) 22.91% compared to head (8c33b36) 22.76%.

Files Patch % Lines
...slickgrid/src/custom-elements/aurelia-slickgrid.ts 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1148      +/-   ##
==========================================
- Coverage   22.91%   22.76%   -0.15%     
==========================================
  Files           8        8              
  Lines         895      901       +6     
  Branches      314      315       +1     
==========================================
  Hits          205      205              
- Misses        690      696       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ghiscoding ghiscoding merged commit f4f64b3 into master Jan 19, 2024
3 of 4 checks passed
@ghiscoding ghiscoding deleted the perf/multiple-autosize-cols branch January 19, 2024 05:29
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.

None yet

1 participant