Skip to content

[labs/virtualizer] Fix #3481 and #3518#3519

Merged
graynorton merged 4 commits intomainfrom
fix-3481
Dec 15, 2022
Merged

[labs/virtualizer] Fix #3481 and #3518#3519
graynorton merged 4 commits intomainfrom
fix-3481

Conversation

@graynorton
Copy link
Copy Markdown
Contributor

@graynorton graynorton commented Dec 13, 2022

Fix #3481 and #3518

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 13, 2022

🦋 Changeset detected

Latest commit: da8eb5f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lit-labs/virtualizer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 13, 2022

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -5% - +2% (-1.06ms - +0.51ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 85.02ms - 89.96ms
  • lit-html-kitchen-sink: unsure 🔍 -7% - +1% (-2.35ms - +0.41ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -5% - +5% (-0.58ms - +0.59ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +2% (-1.10ms - +1.10ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -4% - +1% (-2.21ms - +0.67ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 780.08ms - 792.97ms
  • lit-html-kitchen-sink: unsure 🔍 -5% - +2% (-4.14ms - +1.48ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -3% - +1% (-8.07ms - +2.44ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -1% - +2% (-1.40ms - +2.70ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +2% (-5.10ms - +12.58ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 779.98ms - 787.42ms
  • reactive-element-list: unsure 🔍 -1% - +1% (-5.08ms - +10.95ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
85.02ms - 89.96ms-

update

VersionAvg timevs
780.08ms - 792.97ms-

update-reflect

VersionAvg timevs
779.98ms - 787.42ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
31.20ms - 32.46ms-unsure 🔍
-7% - +1%
-2.35ms - +0.41ms
unsure 🔍
-5% - +2%
-1.51ms - +0.76ms
tip-of-tree
tip-of-tree
31.57ms - 34.03msunsure 🔍
-1% - +7%
-0.41ms - +2.35ms
-unsure 🔍
-3% - +7%
-0.95ms - +2.14ms
previous-release
previous-release
31.27ms - 33.15msunsure 🔍
-2% - +5%
-0.76ms - +1.51ms
unsure 🔍
-6% - +3%
-2.14ms - +0.95ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
83.19ms - 87.30ms-unsure 🔍
-5% - +2%
-4.14ms - +1.48ms
unsure 🔍
-3% - +4%
-2.67ms - +3.24ms
tip-of-tree
tip-of-tree
84.65ms - 88.50msunsure 🔍
-2% - +5%
-1.48ms - +4.14ms
-unsure 🔍
-2% - +5%
-1.26ms - +4.48ms
previous-release
previous-release
82.84ms - 87.09msunsure 🔍
-4% - +3%
-3.24ms - +2.67ms
unsure 🔍
-5% - +1%
-4.48ms - +1.26ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
22.60ms - 23.56ms-unsure 🔍
-5% - +2%
-1.06ms - +0.51ms
unsure 🔍
-3% - +3%
-0.67ms - +0.65ms
tip-of-tree
tip-of-tree
22.74ms - 23.98msunsure 🔍
-2% - +5%
-0.51ms - +1.06ms
-unsure 🔍
-2% - +4%
-0.50ms - +1.04ms
previous-release
previous-release
22.63ms - 23.55msunsure 🔍
-3% - +3%
-0.65ms - +0.67ms
unsure 🔍
-4% - +2%
-1.04ms - +0.50ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.42ms - 12.24ms-unsure 🔍
-5% - +5%
-0.58ms - +0.59ms
unsure 🔍
-8% - +1%
-1.00ms - +0.12ms
tip-of-tree
tip-of-tree
11.41ms - 12.24msunsure 🔍
-5% - +5%
-0.59ms - +0.58ms
-unsure 🔍
-8% - +1%
-1.01ms - +0.12ms
previous-release
previous-release
11.89ms - 12.65msunsure 🔍
-1% - +9%
-0.12ms - +1.00ms
unsure 🔍
-1% - +9%
-0.12ms - +1.01ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
297.67ms - 303.50ms-unsure 🔍
-3% - +1%
-8.07ms - +2.44ms
faster ✔
0% - 4%
1.24ms - 11.65ms
tip-of-tree
tip-of-tree
299.03ms - 307.77msunsure 🔍
-1% - +3%
-2.44ms - +8.07ms
-unsure 🔍
-3% - +1%
-9.77ms - +2.51ms
previous-release
previous-release
302.72ms - 311.34msslower ❌
0% - 4%
1.24ms - 11.65ms
unsure 🔍
-1% - +3%
-2.51ms - +9.77ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
54.69ms - 56.47ms-unsure 🔍
-2% - +2%
-1.10ms - +1.10ms
unsure 🔍
-1% - +3%
-0.77ms - +1.47ms
tip-of-tree
tip-of-tree
54.94ms - 56.22msunsure 🔍
-2% - +2%
-1.10ms - +1.10ms
-unsure 🔍
-1% - +2%
-0.58ms - +1.29ms
previous-release
previous-release
54.55ms - 55.91msunsure 🔍
-3% - +1%
-1.47ms - +0.77ms
unsure 🔍
-2% - +1%
-1.29ms - +0.58ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
119.56ms - 122.42ms-unsure 🔍
-1% - +2%
-1.40ms - +2.70ms
unsure 🔍
-1% - +2%
-1.12ms - +2.73ms
tip-of-tree
tip-of-tree
118.87ms - 121.82msunsure 🔍
-2% - +1%
-2.70ms - +1.40ms
-unsure 🔍
-2% - +2%
-1.81ms - +2.11ms
previous-release
previous-release
118.90ms - 121.48msunsure 🔍
-2% - +1%
-2.73ms - +1.12ms
unsure 🔍
-2% - +1%
-2.11ms - +1.81ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
53.63ms - 55.58ms-unsure 🔍
-4% - +1%
-2.21ms - +0.67ms
unsure 🔍
-3% - +2%
-1.54ms - +1.18ms
tip-of-tree
tip-of-tree
54.31ms - 56.44msunsure 🔍
-1% - +4%
-0.67ms - +2.21ms
-unsure 🔍
-2% - +4%
-0.84ms - +2.02ms
previous-release
previous-release
53.83ms - 55.74msunsure 🔍
-2% - +3%
-1.18ms - +1.54ms
unsure 🔍
-4% - +2%
-2.02ms - +0.84ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
795.10ms - 807.11ms-unsure 🔍
-1% - +2%
-5.10ms - +12.58ms
unsure 🔍
-1% - +1%
-5.50ms - +10.83ms
tip-of-tree
tip-of-tree
790.88ms - 803.85msunsure 🔍
-2% - +1%
-12.58ms - +5.10ms
-unsure 🔍
-1% - +1%
-9.60ms - +7.45ms
previous-release
previous-release
792.90ms - 803.98msunsure 🔍
-1% - +1%
-10.83ms - +5.50ms
unsure 🔍
-1% - +1%
-7.45ms - +9.60ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
814.02ms - 826.58ms-unsure 🔍
-1% - +1%
-5.08ms - +10.95ms
unsure 🔍
-0% - +2%
-2.77ms - +12.89ms
tip-of-tree
tip-of-tree
812.38ms - 822.34msunsure 🔍
-1% - +1%
-10.95ms - +5.08ms
-unsure 🔍
-1% - +1%
-4.71ms - +8.95ms
previous-release
previous-release
810.57ms - 819.90msunsure 🔍
-2% - +0%
-12.89ms - +2.77ms
unsure 🔍
-1% - +1%
-8.95ms - +4.71ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link
Copy Markdown
Contributor

@usergenic usergenic left a comment

Choose a reason for hiding this comment

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

LGTM

if (this._layoutCompletePromise && this._pendingLayoutComplete === null) {
// Wait one additional frame to be sure the layout is stable
this._pendingLayoutComplete = requestAnimationFrame(() =>
requestAnimationFrame(() => this._resolveLayoutCompletePromise())
Copy link
Copy Markdown
Contributor

@usergenic usergenic Dec 15, 2022

Choose a reason for hiding this comment

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

Interesting! I like the locality/cleanliness of expressing the extra nesting RAF here. It appears to mean that resolving the layout complete promise is no longer deferrable past the second RAF, however, since this._resolveLayoutCompletePromise() is late bound and will be called "no matter what". I am trying to contrive a scenario where that would pose a risk...

Considering a case where _childrenSizeChanged() is called due to observation and that triggers a subsequent scheduleLayoutComplete but the subsequent one doesn't wait yet-another two animation frames-- I'll tell you what I'll make an issue to add more cases to the layout complete tests to verify expectations around cascading resize effects and the layoutComplete promise as a separate issue and approve this as is.

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.

Yeah, a full set of layoutComplete tests would be great. I think any given cycle of child measurements and re-layouts is going to occur within a single frame, so believe this logic is ok—but we should certainly confirm via tests.

@graynorton graynorton merged commit 393e30c into main Dec 15, 2022
@graynorton graynorton deleted the fix-3481 branch December 15, 2022 04:29
This was referenced Dec 15, 2022
43081j pushed a commit to 43081j/lit-html that referenced this pull request Jan 4, 2023
* add test for lit#3518

* add fix for lit#3518

* add test for lit#3481

* add fix for lit#3481
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.

[labs/virtualizer] Error when immediately re-rendering (before async connect code runs)

2 participants