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

[lit-html] change CompiledTemplate h field to a TemplateStringsArray #3987

Merged
merged 6 commits into from Jun 30, 2023

Conversation

AndrewJakubowicz
Copy link
Contributor

@AndrewJakubowicz AndrewJakubowicz commented Jun 29, 2023

Similar to: #2642

Thank you @rictic for proposing this!

NOTE: changing technique to a branding tag function.

@changeset-bot
Copy link

changeset-bot bot commented Jun 29, 2023

🦋 Changeset detected

Latest commit: 05d9469

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

This PR includes changesets to release 2 packages
Name Type
lit-html Patch
lit 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 29, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -15% - +4% (-3.40ms - +0.99ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 66.73ms - 70.03ms
  • lit-html-kitchen-sink: unsure 🔍 -12% - +3% (-3.94ms - +1.16ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +3% (-0.23ms - +0.29ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -6% - +1% (-2.79ms - +0.49ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +2% (-0.29ms - +0.88ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 663.02ms - 674.34ms
  • lit-html-kitchen-sink: unsure 🔍 -2% - +8% (-1.31ms - +6.23ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -5% - +3% (-13.93ms - +7.47ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -2% - +1% (-2.20ms - +0.65ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -1% - +1% (-3.60ms - +5.78ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 631.44ms - 639.55ms
  • reactive-element-list: unsure 🔍 -1% - +1% (-3.41ms - +3.91ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
66.73ms - 70.03ms-

update

VersionAvg timevs
663.02ms - 674.34ms-

update-reflect

VersionAvg timevs
631.44ms - 639.55ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
28.15ms - 31.22ms-unsure 🔍
-12% - +3%
-3.94ms - +1.16ms
unsure 🔍
-5% - +12%
-1.30ms - +3.51ms
tip-of-tree
tip-of-tree
29.04ms - 33.11msunsure 🔍
-4% - +13%
-1.16ms - +3.94ms
-unsure 🔍
-1% - +19%
-0.26ms - +5.25ms
previous-release
previous-release
26.73ms - 30.44msunsure 🔍
-12% - +4%
-3.51ms - +1.30ms
unsure 🔍
-17% - +0%
-5.25ms - +0.26ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
73.32ms - 79.46ms-unsure 🔍
-2% - +8%
-1.31ms - +6.23ms
unsure 🔍
-4% - +6%
-3.08ms - +4.47ms
tip-of-tree
tip-of-tree
71.73ms - 76.13msunsure 🔍
-8% - +2%
-6.23ms - +1.31ms
-unsure 🔍
-6% - +2%
-4.87ms - +1.35ms
previous-release
previous-release
73.49ms - 77.89msunsure 🔍
-6% - +4%
-4.47ms - +3.08ms
unsure 🔍
-2% - +7%
-1.35ms - +4.87ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
20.08ms - 22.84ms-unsure 🔍
-15% - +4%
-3.40ms - +0.99ms
unsure 🔍
-12% - +6%
-2.64ms - +1.40ms
tip-of-tree
tip-of-tree
20.95ms - 24.38msunsure 🔍
-5% - +16%
-0.99ms - +3.40ms
-unsure 🔍
-8% - +13%
-1.67ms - +2.85ms
previous-release
previous-release
20.60ms - 23.56msunsure 🔍
-7% - +12%
-1.40ms - +2.64ms
unsure 🔍
-12% - +7%
-2.85ms - +1.67ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
9.84ms - 10.20ms-unsure 🔍
-2% - +3%
-0.23ms - +0.29ms
unsure 🔍
-5% - +0%
-0.48ms - +0.02ms
tip-of-tree
tip-of-tree
9.80ms - 10.17msunsure 🔍
-3% - +2%
-0.29ms - +0.23ms
-faster ✔
0% - 5%
0.01ms - 0.52ms
previous-release
previous-release
10.08ms - 10.42msunsure 🔍
-0% - +5%
-0.02ms - +0.48ms
slower ❌
0% - 5%
0.01ms - 0.52ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
247.12ms - 258.97ms-unsure 🔍
-5% - +3%
-13.93ms - +7.47ms
unsure 🔍
-3% - +3%
-7.48ms - +7.57ms
tip-of-tree
tip-of-tree
247.37ms - 265.18msunsure 🔍
-3% - +6%
-7.47ms - +13.93ms
-unsure 🔍
-3% - +5%
-6.76ms - +13.31ms
previous-release
previous-release
248.37ms - 257.63msunsure 🔍
-3% - +3%
-7.57ms - +7.48ms
unsure 🔍
-5% - +3%
-13.31ms - +6.76ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
47.70ms - 49.08ms-unsure 🔍
-6% - +1%
-2.79ms - +0.49ms
unsure 🔍
-3% - +1%
-1.43ms - +0.70ms
tip-of-tree
tip-of-tree
48.06ms - 51.03msunsure 🔍
-1% - +6%
-0.49ms - +2.79ms
-unsure 🔍
-2% - +5%
-0.91ms - +2.48ms
previous-release
previous-release
47.94ms - 49.57msunsure 🔍
-1% - +3%
-0.70ms - +1.43ms
unsure 🔍
-5% - +2%
-2.48ms - +0.91ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
98.05ms - 99.71ms-unsure 🔍
-2% - +1%
-2.20ms - +0.65ms
unsure 🔍
-1% - +1%
-1.18ms - +1.25ms
tip-of-tree
tip-of-tree
98.50ms - 100.82msunsure 🔍
-1% - +2%
-0.65ms - +2.20ms
-unsure 🔍
-1% - +2%
-0.65ms - +2.27ms
previous-release
previous-release
97.96ms - 99.73msunsure 🔍
-1% - +1%
-1.25ms - +1.18ms
unsure 🔍
-2% - +1%
-2.27ms - +0.65ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
45.84ms - 47.10ms-unsure 🔍
-1% - +3%
-0.49ms - +1.22ms
unsure 🔍
-2% - +2%
-0.71ms - +0.98ms
tip-of-tree
tip-of-tree
45.53ms - 46.68msunsure 🔍
-3% - +1%
-1.22ms - +0.49ms
-unsure 🔍
-2% - +1%
-1.03ms - +0.57ms
previous-release
previous-release
45.78ms - 46.89msunsure 🔍
-2% - +2%
-0.98ms - +0.71ms
unsure 🔍
-1% - +2%
-0.57ms - +1.03ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
784.22ms - 810.07ms-unsure 🔍
-3% - +2%
-20.17ms - +17.18ms
unsure 🔍
-2% - +3%
-12.94ms - +22.74ms
tip-of-tree
tip-of-tree
785.16ms - 812.12msunsure 🔍
-2% - +3%
-17.18ms - +20.17ms
-unsure 🔍
-2% - +3%
-11.85ms - +24.63ms
previous-release
previous-release
779.95ms - 804.54msunsure 🔍
-3% - +2%
-22.74ms - +12.94ms
unsure 🔍
-3% - +1%
-24.63ms - +11.85ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
763.58ms - 788.15ms-unsure 🔍
-2% - +2%
-15.93ms - +17.81ms
unsure 🔍
-2% - +3%
-12.09ms - +20.62ms
tip-of-tree
tip-of-tree
763.36ms - 786.49msunsure 🔍
-2% - +2%
-17.81ms - +15.93ms
-unsure 🔍
-2% - +2%
-12.49ms - +19.14ms
previous-release
previous-release
760.81ms - 782.39msunsure 🔍
-3% - +2%
-20.62ms - +12.09ms
unsure 🔍
-2% - +2%
-19.14ms - +12.49ms
-

tachometer-reporter-action v2 for Benchmarks

@AndrewJakubowicz AndrewJakubowicz marked this pull request as draft June 29, 2023 20:53
@AndrewJakubowicz AndrewJakubowicz changed the title Add Static brand to CompiledTemplate Add brand to CompiledTemplate Jun 29, 2023
@AndrewJakubowicz AndrewJakubowicz marked this pull request as ready for review June 29, 2023 23:09
Copy link
Collaborator

@rictic rictic left a comment

Choose a reason for hiding this comment

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

Mind checking out how many bytes this adds to the 3.0 branch? Just merge it into 3.0 and then do npm run benchmark:size

.changeset/weak-roses-laugh.md Outdated Show resolved Hide resolved
packages/lit-html/src/lit-html.ts Show resolved Hide resolved
@AndrewJakubowicz
Copy link
Contributor Author

Tested memory impact of this change:

This is a size regression. It adds 42 bytes to lit-core.min.js which is 14,740B at head. We're very sensitive to size increases. If this is intended, please update expectedLitCoreSize to 14782 in scripts/check-size.js and push a new commit to your PR.

This is a size regression. It adds 36 bytes to lit-html.js which is 7,220B at head. We're very sensitive to size increases. If this is intended, please update expectedLitHtmlSize to 7256 in scripts/check-size.js and push a new commit to your PR.

@rictic
Copy link
Collaborator

rictic commented Jun 29, 2023

36 bytes well spent!

Copy link
Collaborator

@rictic rictic left a comment

Choose a reason for hiding this comment

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

Great work!

Copy link
Member

@augustjk augustjk left a comment

Choose a reason for hiding this comment

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

Great!

@AndrewJakubowicz AndrewJakubowicz changed the title Add brand to CompiledTemplate [lit-html] brand the CompiledTemplate Jun 29, 2023
@AndrewJakubowicz AndrewJakubowicz changed the title [lit-html] brand the CompiledTemplate [lit-html] change CompiledTemplate h field to a TemplateStringsArray Jun 30, 2023
@AndrewJakubowicz AndrewJakubowicz merged commit bb2560f into main Jun 30, 2023
7 checks passed
@AndrewJakubowicz AndrewJakubowicz deleted the static-brand-2 branch June 30, 2023 00:57
@lit-robot lit-robot mentioned this pull request Jul 5, 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.

None yet

3 participants