Skip to content

[context] Add type parameter for key to createContext()#3628

Merged
justinfagnani merged 1 commit intomainfrom
context-key-type
Feb 2, 2023
Merged

[context] Add type parameter for key to createContext()#3628
justinfagnani merged 1 commit intomainfrom
context-key-type

Conversation

@justinfagnani
Copy link
Copy Markdown
Collaborator

Small change to get more accurate types. Should be non breaking as the second type parameter has a default and doesn't have to be specified.

cc @benjamind

@justinfagnani justinfagnani requested a review from sorvell February 1, 2023 20:25
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 1, 2023

🦋 Changeset detected

Latest commit: 5d50e8a

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/context 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 Feb 1, 2023

📊 Tachometer Benchmark Results

Summary

nop-update

  • lit-html-kitchen-sink: unsure 🔍 -9% - +11% (-2.17ms - +2.77ms)
    this-change vs tip-of-tree

render

  • lit-element-list: 74.66ms - 78.29ms
  • lit-html-kitchen-sink: unsure 🔍 -4% - +3% (-1.13ms - +0.92ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -9% - +5% (-1.08ms - +0.58ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: faster ✔ 0% - 4% (0.19ms - 1.99ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -3% - +2% (-1.29ms - +1.14ms)
    this-change vs tip-of-tree

update

  • lit-element-list: 687.46ms - 693.78ms
  • lit-html-kitchen-sink: unsure 🔍 -5% - +3% (-3.70ms - +2.37ms)
    this-change vs tip-of-tree
  • lit-html-repeat: unsure 🔍 -2% - +3% (-6.61ms - +6.91ms)
    this-change vs tip-of-tree
  • lit-html-template-heavy: unsure 🔍 -0% - +1% (-0.20ms - +1.28ms)
    this-change vs tip-of-tree
  • reactive-element-list: unsure 🔍 -0% - +1% (-3.38ms - +3.94ms)
    this-change vs tip-of-tree

update-reflect

  • lit-element-list: 692.46ms - 696.83ms
  • reactive-element-list: unsure 🔍 -0% - +1% (-2.69ms - +3.78ms)
    this-change vs tip-of-tree

Results

lit-element-list

render

VersionAvg timevs
74.66ms - 78.29ms-

update

VersionAvg timevs
687.46ms - 693.78ms-

update-reflect

VersionAvg timevs
692.46ms - 696.83ms-
lit-html-kitchen-sink

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
29.61ms - 31.29ms-unsure 🔍
-4% - +3%
-1.13ms - +0.92ms
unsure 🔍
-5% - +2%
-1.46ms - +0.65ms
tip-of-tree
tip-of-tree
29.96ms - 31.15msunsure 🔍
-3% - +4%
-0.92ms - +1.13ms
-unsure 🔍
-4% - +2%
-1.17ms - +0.57ms
previous-release
previous-release
30.22ms - 31.50msunsure 🔍
-2% - +5%
-0.65ms - +1.46ms
unsure 🔍
-2% - +4%
-0.57ms - +1.17ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
75.80ms - 80.19ms-unsure 🔍
-5% - +3%
-3.70ms - +2.37ms
unsure 🔍
-11% - +1%
-9.10ms - +1.36ms
tip-of-tree
tip-of-tree
76.56ms - 80.75msunsure 🔍
-3% - +5%
-2.37ms - +3.70ms
-unsure 🔍
-10% - +2%
-8.40ms - +1.98ms
previous-release
previous-release
77.12ms - 86.61msunsure 🔍
-2% - +12%
-1.36ms - +9.10ms
unsure 🔍
-3% - +11%
-1.98ms - +8.40ms
-

nop-update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
23.65ms - 27.43ms-unsure 🔍
-9% - +11%
-2.17ms - +2.77ms
unsure 🔍
-5% - +14%
-1.25ms - +3.39ms
tip-of-tree
tip-of-tree
23.65ms - 26.84msunsure 🔍
-11% - +8%
-2.77ms - +2.17ms
-unsure 🔍
-5% - +12%
-1.31ms - +2.85ms
previous-release
previous-release
23.14ms - 25.81msunsure 🔍
-13% - +5%
-3.39ms - +1.25ms
unsure 🔍
-11% - +5%
-2.85ms - +1.31ms
-
lit-html-repeat

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
11.33ms - 12.11ms-unsure 🔍
-9% - +5%
-1.08ms - +0.58ms
unsure 🔍
-5% - +4%
-0.59ms - +0.52ms
tip-of-tree
tip-of-tree
11.24ms - 12.70msunsure 🔍
-5% - +9%
-0.58ms - +1.08ms
-unsure 🔍
-5% - +9%
-0.62ms - +1.05ms
previous-release
previous-release
11.36ms - 12.15msunsure 🔍
-4% - +5%
-0.52ms - +0.59ms
unsure 🔍
-9% - +5%
-1.05ms - +0.62ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
265.65ms - 274.75ms-unsure 🔍
-2% - +3%
-6.61ms - +6.91ms
unsure 🔍
-5% - +1%
-13.76ms - +1.74ms
tip-of-tree
tip-of-tree
265.05ms - 275.05msunsure 🔍
-3% - +2%
-6.91ms - +6.61ms
-unsure 🔍
-5% - +1%
-14.18ms - +1.86ms
previous-release
previous-release
269.93ms - 282.48msunsure 🔍
-1% - +5%
-1.74ms - +13.76ms
unsure 🔍
-1% - +5%
-1.86ms - +14.18ms
-
lit-html-template-heavy

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
50.56ms - 51.71ms-faster ✔
0% - 4%
0.19ms - 1.99ms
unsure 🔍
-2% - +1%
-1.15ms - +0.49ms
tip-of-tree
tip-of-tree
51.54ms - 52.91msslower ❌
0% - 4%
0.19ms - 1.99ms
-unsure 🔍
-0% - +3%
-0.15ms - +1.67ms
previous-release
previous-release
50.88ms - 52.06msunsure 🔍
-1% - +2%
-0.49ms - +1.15ms
unsure 🔍
-3% - +0%
-1.67ms - +0.15ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
106.32ms - 107.31ms-unsure 🔍
-0% - +1%
-0.20ms - +1.28ms
unsure 🔍
-1% - +1%
-0.66ms - +1.09ms
tip-of-tree
tip-of-tree
105.73ms - 106.82msunsure 🔍
-1% - +0%
-1.28ms - +0.20ms
-unsure 🔍
-1% - +1%
-1.23ms - +0.58ms
previous-release
previous-release
105.88ms - 107.32msunsure 🔍
-1% - +1%
-1.09ms - +0.66ms
unsure 🔍
-1% - +1%
-0.58ms - +1.23ms
-
reactive-element-list

render

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
48.79ms - 50.67ms-unsure 🔍
-3% - +2%
-1.29ms - +1.14ms
unsure 🔍
-3% - +2%
-1.67ms - +0.79ms
tip-of-tree
tip-of-tree
49.03ms - 50.58msunsure 🔍
-2% - +3%
-1.14ms - +1.29ms
-unsure 🔍
-3% - +1%
-1.48ms - +0.75ms
previous-release
previous-release
49.37ms - 50.97msunsure 🔍
-2% - +3%
-0.79ms - +1.67ms
unsure 🔍
-2% - +3%
-0.75ms - +1.48ms
-

update

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
691.90ms - 696.99ms-unsure 🔍
-0% - +1%
-3.38ms - +3.94ms
unsure 🔍
-1% - +1%
-3.81ms - +3.51ms
tip-of-tree
tip-of-tree
691.53ms - 696.80msunsure 🔍
-1% - +0%
-3.94ms - +3.38ms
-unsure 🔍
-1% - +0%
-4.15ms - +3.30ms
previous-release
previous-release
691.96ms - 697.23msunsure 🔍
-1% - +1%
-3.51ms - +3.81ms
unsure 🔍
-0% - +1%
-3.30ms - +4.15ms
-

update-reflect

VersionAvg timevs this-change
vs tip-of-tree
tip-of-tree
vs previous-release
previous-release
this-change
724.89ms - 729.77ms-unsure 🔍
-0% - +1%
-2.69ms - +3.78ms
unsure 🔍
-0% - +1%
-0.81ms - +6.52ms
tip-of-tree
tip-of-tree
724.66ms - 728.91msunsure 🔍
-1% - +0%
-3.78ms - +2.69ms
-unsure 🔍
-0% - +1%
-1.15ms - +5.77ms
previous-release
previous-release
721.74ms - 727.21msunsure 🔍
-1% - +0%
-6.52ms - +0.81ms
unsure 🔍
-1% - +0%
-5.77ms - +1.15ms
-

tachometer-reporter-action v2 for Benchmarks

@justinfagnani justinfagnani changed the title Add type parameter for key to createContext() [context] Add type parameter for key to createContext() Feb 2, 2023
@justinfagnani justinfagnani merged commit 61ce814 into main Feb 2, 2023
@justinfagnani justinfagnani deleted the context-key-type branch February 2, 2023 17:21
@justinfagnani
Copy link
Copy Markdown
Collaborator Author

Thanks @sorvell!

@lit-robot lit-robot mentioned this pull request Mar 10, 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.

2 participants