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

[labs/ssr] Fix hydration for nested custom elements without attributes #3942

Merged
merged 4 commits into from Jun 13, 2023

Conversation

augustjk
Copy link
Member

@augustjk augustjk commented Jun 8, 2023

Fixes #3939

The check for node.attrs.length > 0 made it so that op code for 'possible-node-marker' was never getting added even for nested custom elements if they had no attributes. Removing that condition check fixes this. There shouldn't be much extra work being done by removing this condition as most of the code in the block are for loops over the derived attrInfo array which would be empty if node.attrs.length is 0.

@changeset-bot
Copy link

changeset-bot bot commented Jun 8, 2023

🦋 Changeset detected

Latest commit: 59fe9f7

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/ssr 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
Contributor

github-actions bot commented Jun 8, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -8% - +7% (-1.27ms - +1.19ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 73.33ms - 76.43ms
  • lit-html-kitchen-sink: unsure 🔍 -8% - +5% (-2.38ms - +1.62ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -3% - +9% (-0.31ms - +0.92ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -3% - +2% (-1.71ms - +1.36ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -3% - +3% (-1.68ms - +1.28ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 811.62ms - 820.19ms
  • lit-html-kitchen-sink: unsure 🔍 -1% - +7% (-1.01ms - +5.39ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -3% - +3% (-8.39ms - +7.26ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +2% (-2.38ms - +2.25ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -0% - +2% (-3.26ms - +12.72ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 782.54ms - 789.94ms
  • reactive-element-list: unsure 🔍 -1% - +1% (-5.52ms - +7.39ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
73.33ms - 76.43ms-

update

VersionAvg timevs
811.62ms - 820.19ms-

update-reflect

VersionAvg timevs
782.54ms - 789.94ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
29.39ms - 32.10ms-unsure 🔍
-8% - +5%
-2.38ms - +1.62ms
unsure 🔍
-3% - +9%
-1.02ms - +2.71ms
tip-of-tree
tip-of-tree
29.65ms - 32.60msunsure 🔍
-5% - +8%
-1.62ms - +2.38ms
-unsure 🔍
-3% - +11%
-0.73ms - +3.18ms
previous-release
previous-release
28.62ms - 31.18msunsure 🔍
-9% - +3%
-2.71ms - +1.02ms
unsure 🔍
-10% - +2%
-3.18ms - +0.73ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
76.82ms - 80.90ms-unsure 🔍
-1% - +7%
-1.01ms - +5.39ms
unsure 🔍
-5% - +4%
-3.66ms - +3.16ms
tip-of-tree
tip-of-tree
74.21ms - 79.13msunsure 🔍
-7% - +1%
-5.39ms - +1.01ms
-unsure 🔍
-8% - +1%
-6.11ms - +1.24ms
previous-release
previous-release
76.38ms - 81.84msunsure 🔍
-4% - +5%
-3.16ms - +3.66ms
unsure 🔍
-2% - +8%
-1.24ms - +6.11ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
15.77ms - 17.73ms-unsure 🔍
-8% - +7%
-1.27ms - +1.19ms
unsure 🔍
-11% - +5%
-1.93ms - +0.93ms
tip-of-tree
tip-of-tree
16.04ms - 17.54msunsure 🔍
-7% - +8%
-1.19ms - +1.27ms
-unsure 🔍
-10% - +5%
-1.74ms - +0.82ms
previous-release
previous-release
16.21ms - 18.29msunsure 🔍
-6% - +12%
-0.93ms - +1.93ms
unsure 🔍
-5% - +10%
-0.82ms - +1.74ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
10.59ms - 11.48ms-unsure 🔍
-3% - +9%
-0.31ms - +0.92ms
unsure 🔍
-7% - +10%
-0.76ms - +1.06ms
tip-of-tree
tip-of-tree
10.30ms - 11.15msunsure 🔍
-8% - +3%
-0.92ms - +0.31ms
-unsure 🔍
-10% - +7%
-1.06ms - +0.74ms
previous-release
previous-release
10.09ms - 11.68msunsure 🔍
-10% - +7%
-1.06ms - +0.76ms
unsure 🔍
-7% - +10%
-0.74ms - +1.06ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
270.63ms - 282.05ms-unsure 🔍
-3% - +3%
-8.39ms - +7.26ms
unsure 🔍
-2% - +4%
-4.29ms - +11.01ms
tip-of-tree
tip-of-tree
271.55ms - 282.26msunsure 🔍
-3% - +3%
-7.26ms - +8.39ms
-unsure 🔍
-1% - +4%
-3.47ms - +11.31ms
previous-release
previous-release
267.89ms - 278.08msunsure 🔍
-4% - +2%
-11.01ms - +4.29ms
unsure 🔍
-4% - +1%
-11.31ms - +3.47ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
54.14ms - 56.47ms-unsure 🔍
-3% - +2%
-1.71ms - +1.36ms
unsure 🔍
-2% - +4%
-1.21ms - +1.97ms
tip-of-tree
tip-of-tree
54.48ms - 56.49msunsure 🔍
-2% - +3%
-1.36ms - +1.71ms
-unsure 🔍
-2% - +4%
-0.92ms - +2.04ms
previous-release
previous-release
53.83ms - 56.01msunsure 🔍
-4% - +2%
-1.97ms - +1.21ms
unsure 🔍
-4% - +2%
-2.04ms - +0.92ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
107.67ms - 111.32ms-unsure 🔍
-2% - +2%
-2.38ms - +2.25ms
unsure 🔍
-1% - +3%
-0.96ms - +3.53ms
tip-of-tree
tip-of-tree
108.13ms - 110.99msunsure 🔍
-2% - +2%
-2.25ms - +2.38ms
-unsure 🔍
-1% - +3%
-0.59ms - +3.29ms
previous-release
previous-release
106.90ms - 109.52msunsure 🔍
-3% - +1%
-3.53ms - +0.96ms
unsure 🔍
-3% - +1%
-3.29ms - +0.59ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
48.72ms - 50.84ms-unsure 🔍
-3% - +3%
-1.68ms - +1.28ms
unsure 🔍
-4% - +2%
-1.95ms - +0.80ms
tip-of-tree
tip-of-tree
48.94ms - 51.02msunsure 🔍
-3% - +3%
-1.28ms - +1.68ms
-unsure 🔍
-3% - +2%
-1.73ms - +0.98ms
previous-release
previous-release
49.48ms - 51.23msunsure 🔍
-2% - +4%
-0.80ms - +1.95ms
unsure 🔍
-2% - +3%
-0.98ms - +1.73ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
839.63ms - 852.17ms-unsure 🔍
-0% - +2%
-3.26ms - +12.72ms
unsure 🔍
-0% - +2%
-3.38ms - +12.81ms
tip-of-tree
tip-of-tree
836.22ms - 846.12msunsure 🔍
-2% - +0%
-12.72ms - +3.26ms
-unsure 🔍
-1% - +1%
-7.14ms - +7.11ms
previous-release
previous-release
836.07ms - 846.31msunsure 🔍
-2% - +0%
-12.81ms - +3.38ms
unsure 🔍
-1% - +1%
-7.11ms - +7.14ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
826.77ms - 835.23ms-unsure 🔍
-1% - +1%
-5.52ms - +7.39ms
unsure 🔍
-1% - +1%
-4.29ms - +8.12ms
tip-of-tree
tip-of-tree
825.19ms - 834.94msunsure 🔍
-1% - +1%
-7.39ms - +5.52ms
-unsure 🔍
-1% - +1%
-5.68ms - +7.64ms
previous-release
previous-release
824.55ms - 833.62msunsure 🔍
-1% - +1%
-8.12ms - +4.29ms
unsure 🔍
-1% - +1%
-7.64ms - +5.68ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz left a comment

Choose a reason for hiding this comment

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

Nice!

@augustjk augustjk merged commit ed42d5f into main Jun 13, 2023
7 checks passed
@augustjk augustjk deleted the ssr-nested-hydrate branch June 13, 2023 19:01
This was referenced Jun 15, 2023
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.

Lit SSR defer-hydration not being removed on subcomponent that do not have a node binding
2 participants