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

fix(positioning): cache management #3214

Closed
wants to merge 1 commit into from

Conversation

fbasso
Copy link
Member

@fbasso fbasso commented May 29, 2019

The purpose of this PR is to increase performance of re-positioning popup by caching the popup dimension values.

It can partially fixed #3199

This is not intended to be straightly merged, as we need to investigate the implications. For example when the popup content changes while it's open (for example, the typeahead).

Copy link
Contributor

@ymeine ymeine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good idea and could indeed improve performances for some use cases, but a properly designed Angular application shouldn't face performance issues related to this piece of code. The latter is executed after every change detection, and change detection cycles should not occur too often.

I would be in favor of such a solution if it would not have to make some strong hypotheses to keep the benefits of the optimization. More precisely, a proper caching solution should take into account the positions and sizes of the host and target elements, and that would still require some expensive calculations from the rendering side.

Therefore I would consider this as not needed

@codecov-io
Copy link

Codecov Report

Merging #3214 into master will increase coverage by 1.32%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #3214      +/-   ##
=========================================
+ Coverage   90.77%   92.1%   +1.32%     
=========================================
  Files          94      92       -2     
  Lines        2711    3102     +391     
  Branches      507     517      +10     
=========================================
+ Hits         2461    2857     +396     
+ Misses        190     179      -11     
- Partials       60      66       +6
Flag Coverage Δ
#e2e 63.41% <100%> (+8.22%) ⬆️
#unit 89.5% <100%> (+1.61%) ⬆️
Impacted Files Coverage Δ
src/typeahead/typeahead.ts 97.35% <ø> (+0.35%) ⬆️
src/dropdown/dropdown.ts 94.61% <ø> (+0.81%) ⬆️
src/popover/popover.ts 100% <ø> (ø) ⬆️
src/datepicker/datepicker-input.ts 96.94% <100%> (-0.05%) ⬇️
src/util/positioning.ts 96.35% <100%> (+0.51%) ⬆️
src/util/triggers.ts 94.82% <0%> (-1.61%) ⬇️
src/index.ts 100% <0%> (ø) ⬆️
src/datepicker/datepicker-month-view.ts 100% <0%> (ø) ⬆️
src/tabset/tabset.module.ts 100% <0%> (ø) ⬆️
src/buttons/buttons.module.ts 100% <0%> (ø) ⬆️
... and 82 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e682ee3...772f3c1. Read the comment docs.

@fbasso fbasso added this to Pending in Positioning Mar 11, 2020
@fbasso fbasso moved this from Pending to To do in Positioning Mar 11, 2020
@fbasso
Copy link
Member Author

fbasso commented Oct 26, 2022

This PR is not valid anymore, as now positioning is done with popperjs

@fbasso fbasso closed this Oct 26, 2022
@fbasso fbasso deleted the position-cache branch August 31, 2023 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Performance issues because of _ngZone.onStable.subscribe
5 participants