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

Fixes for several related dom-repeat chunking issues. Fixes #5631. #5632

Merged
merged 2 commits into from
Feb 22, 2020

Conversation

kevinpschaaf
Copy link
Member

  • Only restart chunking (resetting the list to the initialCount) if the items array itself changed (and not splices to the array), to match Polymer 1 behavior.
  • Add reuseChunkedInstances option to allow reusing instances even when items changes; this is likely the more common optimal case when using immutable data, but making it optional for backward compatibility.
  • Only measure render time and throttle the chunk size if we rendered a full chunk of new items. Ensures that fast re-renders of existing items don't cause the chunk size to scale up dramatically, subsequently causing too many new items to be created in one chunk.
  • Increase the limit by the chunk size as part of any render if there are new items to render, rather than only as a result of rendering.
  • Continue chunking by comparing the filtered item count to the limit (not the unfiltered item count).

Reference Issue

Fixes #5631

* Only restart chunking (resetting the list to the initialCount) if the `items` array itself changed (and not splices to the array), to match Polymer 1 behavior.
* Add `reuseChunkedInstances` option to allow reusing instances even when `items` changes; this is likely the more common optimal case when using immutable data, but making it optional for backward compatibility.
* Only measure render time and throttle the chunk size if we rendered a full chunk of new items. Ensures that fast re-renders of existing items don't cause the chunk size to scale up dramatically, subsequently causing too many new items to be created in one chunk.
* Increase the limit by the chunk size as part of any render if there are new items to render, rather than only as a result of rendering.
* Continue chunking by comparing the filtered item count to the limit (not the unfiltered item count).
lib/elements/dom-repeat.js Show resolved Hide resolved
lib/elements/dom-repeat.js Outdated Show resolved Hide resolved
lib/elements/dom-repeat.js Outdated Show resolved Hide resolved
lib/elements/dom-repeat.js Outdated Show resolved Hide resolved
* Refactoring `__render` for readability
* Removing `__pool`; this was never used in v2: since we reset the pool every update and items are only ever pushed at detach time and we only detach at the end of updates (as opposed to v1 which had more sophisticated splicing)
@kevinpschaaf kevinpschaaf merged commit 5421b5b into legacy-undefined-noBatch Feb 22, 2020
@kevinpschaaf kevinpschaaf deleted the legacy-undefined-noBatch-5631 branch February 22, 2020 01:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants