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] Allow rendering of non-array iterables #3905

Merged
merged 3 commits into from May 23, 2023
Merged

Conversation

augustjk
Copy link
Member

Fixes #3122

@changeset-bot
Copy link

changeset-bot bot commented May 16, 2023

🦋 Changeset detected

Latest commit: c08641e

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 May 16, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -9% - +3% (-1.80ms - +0.62ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 93.22ms - 98.55ms
  • lit-html-kitchen-sink: unsure 🔍 -4% - +10% (-1.35ms - +3.53ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -8% - +5% (-0.99ms - +0.59ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +6% (-1.62ms - +4.20ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -3% - +4% (-1.61ms - +2.44ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 968.91ms - 994.83ms
  • lit-html-kitchen-sink: unsure 🔍 -8% - +4% (-7.84ms - +3.98ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +4% (-7.47ms - +13.37ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -3% - +3% (-4.13ms - +4.33ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +2% (-9.48ms - +22.73ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 928.81ms - 951.29ms
  • reactive-element-list: unsure 🔍 -2% - +1% (-16.30ms - +12.14ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
93.22ms - 98.55ms-

update

VersionAvg timevs
968.91ms - 994.83ms-

update-reflect

VersionAvg timevs
928.81ms - 951.29ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
36.15ms - 39.15ms-unsure 🔍
-4% - +10%
-1.35ms - +3.53ms
unsure 🔍
-0% - +11%
-0.11ms - +3.80ms
tip-of-tree
tip-of-tree
34.64ms - 38.48msunsure 🔍
-9% - +4%
-3.53ms - +1.35ms
-unsure 🔍
-4% - +9%
-1.54ms - +3.05ms
previous-release
previous-release
34.56ms - 37.06msunsure 🔍
-10% - +0%
-3.80ms - +0.11ms
unsure 🔍
-8% - +4%
-3.05ms - +1.54ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
92.11ms - 99.66ms-unsure 🔍
-8% - +4%
-7.84ms - +3.98ms
unsure 🔍
-3% - +7%
-3.12ms - +6.86ms
tip-of-tree
tip-of-tree
93.27ms - 102.36msunsure 🔍
-4% - +8%
-3.98ms - +7.84ms
-unsure 🔍
-2% - +10%
-1.80ms - +9.39ms
previous-release
previous-release
90.76ms - 97.28msunsure 🔍
-7% - +3%
-6.86ms - +3.12ms
unsure 🔍
-9% - +2%
-9.39ms - +1.80ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
18.99ms - 20.41ms-unsure 🔍
-9% - +3%
-1.80ms - +0.62ms
unsure 🔍
-9% - +4%
-1.82ms - +0.85ms
tip-of-tree
tip-of-tree
19.31ms - 21.26msunsure 🔍
-3% - +9%
-0.62ms - +1.80ms
-unsure 🔍
-7% - +8%
-1.39ms - +1.59ms
previous-release
previous-release
19.06ms - 21.31msunsure 🔍
-4% - +9%
-0.85ms - +1.82ms
unsure 🔍
-8% - +7%
-1.59ms - +1.39ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
12.05ms - 13.17ms-unsure 🔍
-8% - +5%
-0.99ms - +0.59ms
unsure 🔍
-11% - +0%
-1.44ms - +0.08ms
tip-of-tree
tip-of-tree
12.25ms - 13.37msunsure 🔍
-5% - +8%
-0.59ms - +0.99ms
-unsure 🔍
-9% - +2%
-1.23ms - +0.28ms
previous-release
previous-release
12.77ms - 13.80msunsure 🔍
-1% - +12%
-0.08ms - +1.44ms
unsure 🔍
-2% - +10%
-0.28ms - +1.23ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
334.45ms - 348.67ms-unsure 🔍
-2% - +4%
-7.47ms - +13.37ms
unsure 🔍
-1% - +4%
-4.35ms - +14.99ms
tip-of-tree
tip-of-tree
331.00ms - 346.22msunsure 🔍
-4% - +2%
-13.37ms - +7.47ms
-unsure 🔍
-2% - +4%
-7.67ms - +12.42ms
previous-release
previous-release
329.68ms - 342.79msunsure 🔍
-4% - +1%
-14.99ms - +4.35ms
unsure 🔍
-4% - +2%
-12.42ms - +7.67ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
67.47ms - 71.95ms-unsure 🔍
-2% - +6%
-1.62ms - +4.20ms
unsure 🔍
-2% - +6%
-1.53ms - +4.17ms
tip-of-tree
tip-of-tree
66.56ms - 70.28msunsure 🔍
-6% - +2%
-4.20ms - +1.62ms
-unsure 🔍
-4% - +4%
-2.54ms - +2.58ms
previous-release
previous-release
66.63ms - 70.15msunsure 🔍
-6% - +2%
-4.17ms - +1.53ms
unsure 🔍
-4% - +4%
-2.58ms - +2.54ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
134.80ms - 140.75ms-unsure 🔍
-3% - +3%
-4.13ms - +4.33ms
unsure 🔍
-2% - +4%
-2.88ms - +5.23ms
tip-of-tree
tip-of-tree
134.67ms - 140.68msunsure 🔍
-3% - +3%
-4.33ms - +4.13ms
-unsure 🔍
-2% - +4%
-3.00ms - +5.16ms
previous-release
previous-release
133.84ms - 139.35msunsure 🔍
-4% - +2%
-5.23ms - +2.88ms
unsure 🔍
-4% - +2%
-5.16ms - +3.00ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
58.16ms - 60.79ms-unsure 🔍
-3% - +4%
-1.61ms - +2.44ms
unsure 🔍
-6% - +1%
-3.37ms - +0.93ms
tip-of-tree
tip-of-tree
57.51ms - 60.61msunsure 🔍
-4% - +3%
-2.44ms - +1.61ms
-unsure 🔍
-6% - +1%
-3.93ms - +0.67ms
previous-release
previous-release
58.99ms - 62.39msunsure 🔍
-2% - +6%
-0.93ms - +3.37ms
unsure 🔍
-1% - +7%
-0.67ms - +3.93ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
970.85ms - 993.78ms-unsure 🔍
-1% - +2%
-9.48ms - +22.73ms
unsure 🔍
-1% - +3%
-5.10ms - +26.77ms
tip-of-tree
tip-of-tree
964.38ms - 986.99msunsure 🔍
-2% - +1%
-22.73ms - +9.48ms
-unsure 🔍
-1% - +2%
-11.61ms - +20.03ms
previous-release
previous-release
960.41ms - 982.55msunsure 🔍
-3% - +1%
-26.77ms - +5.10ms
unsure 🔍
-2% - +1%
-20.03ms - +11.61ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
956.39ms - 975.93ms-unsure 🔍
-2% - +1%
-16.30ms - +12.14ms
unsure 🔍
-1% - +2%
-8.62ms - +20.40ms
tip-of-tree
tip-of-tree
957.91ms - 978.57msunsure 🔍
-1% - +2%
-12.14ms - +16.30ms
-unsure 🔍
-1% - +2%
-6.91ms - +22.87ms
previous-release
previous-release
949.54ms - 970.99msunsure 🔍
-2% - +1%
-20.40ms - +8.62ms
unsure 🔍
-2% - +1%
-22.87ms - +6.91ms
-

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! Great implementation and tests!

I assume a Map would also technically work since it is iterable - but just would return k + v for each entry. No action required.

packages/labs/ssr/src/lib/render-value.ts Outdated Show resolved Hide resolved
Co-authored-by: Andrew Jakubowicz <ajakubowicz@google.com>
@augustjk augustjk merged commit f8d7285 into main May 23, 2023
7 checks passed
@augustjk augustjk deleted the ssr-iterable branch May 23, 2023 20:57
@lit-robot lit-robot mentioned this pull request May 24, 2023
This was referenced May 31, 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.

[labs/ssr] Non-array iterables fail to render
2 participants