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: investigate optimization for updateViews() in repeat #6025

Closed
prudepixie opened this issue May 25, 2022 · 1 comment
Closed

perf: investigate optimization for updateViews() in repeat #6025

prudepixie opened this issue May 25, 2022 · 1 comment
Assignees
Labels
area:fast-element Pertains to fast-element improvement A non-feature-adding improvement status:in-progress Work is in progress

Comments

@prudepixie
Copy link
Contributor

prudepixie commented May 25, 2022

Following some investigation around repeat performance, we looked at a couple of scenarios:

  1. push new element into array
  2. updating existing section of array with new elements

updateViews() in RepeatBehavior class is triggered when array is updated (.splice() , .push()),
According to findings:
"In the way, it will try to apply splice on views, and try to reuse the removed views to bind with new data, insert them to new locations. It looks better than refreshAllViews since it only applies bindView to those updated items,
However, updateViews will always invoke insertBefore, even if it’s an in-place update, like array.splice(0, 1, array[0])."

Some possible points of investigation and benchmarks to write are:

  • Make view.insertBefore() noop when an attempt to insert at the existing location is made
  • Make the repeat skip inserting when the view already exists at the location
@prudepixie prudepixie added this to the FAST Element 2.0 milestone May 25, 2022
@prudepixie prudepixie self-assigned this May 25, 2022
@prudepixie prudepixie moved this from Triage to In Progress in FAST Architecture Roadmap May 25, 2022
@EisenbergEffect EisenbergEffect added improvement A non-feature-adding improvement status:planned Work is planned area:fast-element Pertains to fast-element status:in-progress Work is in progress and removed status:planned Work is planned labels May 26, 2022
@prudepixie
Copy link
Contributor Author

Refer to findings here: Repeat Benchmarks Report

Repository owner moved this from In Progress to Done in FAST Architecture Roadmap Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast-element Pertains to fast-element improvement A non-feature-adding improvement status:in-progress Work is in progress
Projects
Archived in project
Development

No branches or pull requests

2 participants