Skip to content

perf(animations): Remove generic objects in favor of Maps#44482

Closed
jessicajaniuk wants to merge 1 commit intoangular:masterfrom
jessicajaniuk:animation-maps
Closed

perf(animations): Remove generic objects in favor of Maps#44482
jessicajaniuk wants to merge 1 commit intoangular:masterfrom
jessicajaniuk:animation-maps

Conversation

@jessicajaniuk
Copy link
Copy Markdown
Contributor

@jessicajaniuk jessicajaniuk commented Dec 14, 2021

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

We were using a number of generic objects as if they were maps and relying on delete to remove
properties.

Issue Number: N/A

What is the new behavior?

In order to improve performance, these generic objects have been switched to native maps.

Does this PR introduce a breaking change?

  • Yes
  • No

@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 2 times, most recently from e233f8f to be7e805 Compare December 14, 2021 23:52
@jessicajaniuk jessicajaniuk added the area: animations legacy animations package only. Otherwise use area: core. label Dec 14, 2021
@ngbot ngbot Bot added this to the Backlog milestone Dec 14, 2021
@jessicajaniuk jessicajaniuk added the target: patch This PR is targeted for the next patch release label Dec 14, 2021
Comment thread packages/animations/src/animation_metadata.ts Outdated
@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 5 times, most recently from f2c3799 to 24cacd0 Compare December 15, 2021 01:15
Comment thread packages/animations/browser/src/dsl/animation_ast_builder.ts Outdated
Comment thread packages/animations/browser/src/dsl/animation_ast_builder.ts Outdated
Comment thread packages/animations/browser/src/dsl/animation_ast_builder.ts Outdated
Comment thread packages/animations/browser/src/dsl/animation_ast_builder.ts Outdated
Comment thread packages/animations/browser/src/render/timeline_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/timeline_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/transition_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/transition_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/timeline_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/shared.ts Outdated
@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 9 times, most recently from 74bec63 to 84cc81b Compare December 16, 2021 23:12
Comment thread packages/animations/browser/src/dsl/animation_timeline_builder.ts Outdated
Comment thread packages/animations/browser/src/render/special_cased_styles.ts Outdated
Comment thread packages/animations/browser/src/render/special_cased_styles.ts Outdated
Comment thread packages/animations/browser/src/render/timeline_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/render/transition_animation_engine.ts Outdated
Comment thread packages/animations/browser/src/util.ts Outdated
Comment thread packages/animations/browser/src/util.ts Outdated
Comment thread packages/animations/browser/src/render/shared.ts Outdated
@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 4 times, most recently from 0e15016 to 9698f71 Compare December 21, 2021 23:34
@pullapprove pullapprove Bot requested a review from alxhub January 5, 2022 03:36
Copy link
Copy Markdown
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

@pullapprove pullapprove Bot requested a review from AndrewKushnir January 5, 2022 17:26
@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 7 times, most recently from 6437971 to 54e52f8 Compare January 5, 2022 20:42
@jessicajaniuk jessicajaniuk added breaking changes target: major This PR is targeted for the next major release and removed target: patch This PR is targeted for the next patch release labels Jan 5, 2022
@jessicajaniuk jessicajaniuk force-pushed the animation-maps branch 4 times, most recently from 8954cb4 to 24b7039 Compare January 5, 2022 22:43
@jessicajaniuk jessicajaniuk modified the milestones: Backlog, v14-candidates Jan 6, 2022
Copy link
Copy Markdown
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

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

reviewed-for: public-api

Comment on lines 304 to 305
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jessicajaniuk In PR #44729 I am adding a delete tuple[prop] here, after the PR has been merged please remember to update it to tuple.delete(prop) whenever you can 🙂

Original discussion: https://github.com/angular/angular/pull/44729/files#r787206809

Copy link
Copy Markdown
Contributor

@dylhunn dylhunn left a comment

Choose a reason for hiding this comment

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

reviewed-for: fw-core, fw-testing, public-api

@jessicajaniuk
Copy link
Copy Markdown
Contributor Author

TGP is green

Copy link
Copy Markdown
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: I like the StyleData as a symbol name a bit more. The Map part leaks the implementation detail into the name (for ex. we'd need to change the name if we later decide to use an array).

This is a very minor thing, not a blocker for this PR :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I actually agree, but we still use the old symbol. We'd need a new name. I'll think on it for a potential refactor after this PR.

We were using a number of generic objects as if they were maps and relying on delete to remove
properties. In order to improve performance, these have been switched to native maps.
@jessicajaniuk
Copy link
Copy Markdown
Contributor Author

This PR was merged into the repository by commit 7a81481.

@alfaproject
Copy link
Copy Markdown
Contributor

@jessicajaniuk OOC do you have performance numbers before/after?

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: animations legacy animations package only. Otherwise use area: core. breaking changes merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note target: major This PR is targeted for the next major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants