[labs/react] Property and event setter updates
This PR focus on refinement and resilience for our logic during property updates.
Changes include:
- Bailing early on matching properties
- Removing nested
ifstatements to update logic
🦋 Changeset detected
Latest commit: 264a671c18bb25adf6a78e134c4d44c9c76e682a
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/react | 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
📊 Tachometer Benchmark Results
Summary
nop-update
- lit-html-kitchen-sink: unsure 🔍 -2% - +1% (-0.50ms - +0.37ms)
this-change vs tip-of-tree
render
- lit-element-list: 74.20ms - 78.47ms
- lit-html-kitchen-sink: unsure 🔍 -3% - +1% (-0.99ms - +0.30ms)
this-change vs tip-of-tree - lit-html-repeat: unsure 🔍 -4% - +14% (-0.42ms - +1.39ms)
this-change vs tip-of-tree - lit-html-template-heavy: unsure 🔍 -1% - +1% (-0.58ms - +0.49ms)
this-change vs tip-of-tree - reactive-element-list: unsure 🔍 -0% - +3% (-0.09ms - +1.75ms)
this-change vs tip-of-tree
update
- lit-element-list: 779.72ms - 793.96ms
- lit-html-kitchen-sink: unsure 🔍 -4% - +1% (-3.36ms - +0.81ms)
this-change vs tip-of-tree - lit-html-repeat: unsure 🔍 -2% - +0% (-6.25ms - +0.93ms)
this-change vs tip-of-tree - lit-html-template-heavy: unsure 🔍 -1% - +1% (-1.45ms - +1.02ms)
this-change vs tip-of-tree - reactive-element-list: unsure 🔍 -1% - +1% (-5.73ms - +7.08ms)
this-change vs tip-of-tree
update-reflect
- lit-element-list: 790.62ms - 799.28ms
- reactive-element-list: unsure 🔍 -0% - +4% (-4.29ms - +32.15ms)
this-change vs tip-of-tree
Results
lit-element-list
- Browser: chrome-headless 104.0.5112.79
- Sample size: 50
- Built by: Benchmarks #3678
-
Commit: e7d8d3b
render
| Version | Avg time | vs |
|---|---|---|
| 74.20ms - 78.47ms | - |
update
| Version | Avg time | vs |
|---|---|---|
| 779.72ms - 793.96ms | - |
update-reflect
| Version | Avg time | vs |
|---|---|---|
| 790.62ms - 799.28ms | - |
lit-html-kitchen-sink
- Browser: chrome-headless 104.0.5112.79
- Sample size: 30
- Built by: Benchmarks #3678
-
Commit: e7d8d3b
render
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 28.25ms - 28.84ms | - | unsure 🔍 -3% - +1% -0.99ms - +0.30ms | unsure 🔍 -3% - +1% -0.80ms - +0.26ms |
| tip-of-tree tip-of-tree | 28.32ms - 29.47ms | unsure 🔍 -1% - +3% -0.30ms - +0.99ms | - | unsure 🔍 -2% - +3% -0.65ms - +0.80ms |
| previous-release previous-release | 28.38ms - 29.26ms | unsure 🔍 -1% - +3% -0.26ms - +0.80ms | unsure 🔍 -3% - +2% -0.80ms - +0.65ms | - |
update
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 77.72ms - 80.80ms | - | unsure 🔍 -4% - +1% -3.36ms - +0.81ms | unsure 🔍 -3% - +3% -2.02ms - +2.37ms |
| tip-of-tree tip-of-tree | 79.13ms - 81.94ms | unsure 🔍 -1% - +4% -0.81ms - +3.36ms | - | unsure 🔍 -1% - +5% -0.65ms - +3.55ms |
| previous-release previous-release | 77.53ms - 80.64ms | unsure 🔍 -3% - +3% -2.37ms - +2.02ms | unsure 🔍 -4% - +1% -3.55ms - +0.65ms | - |
nop-update
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 24.31ms - 24.95ms | - | unsure 🔍 -2% - +1% -0.50ms - +0.37ms | unsure 🔍 -2% - +1% -0.45ms - +0.33ms |
| tip-of-tree tip-of-tree | 24.40ms - 24.98ms | unsure 🔍 -2% - +2% -0.37ms - +0.50ms | - | unsure 🔍 -1% - +1% -0.36ms - +0.37ms |
| previous-release previous-release | 24.47ms - 24.90ms | unsure 🔍 -1% - +2% -0.33ms - +0.45ms | unsure 🔍 -1% - +1% -0.37ms - +0.36ms | - |
lit-html-repeat
- Browser: chrome-headless 104.0.5112.79
- Sample size: 30
- Built by: Benchmarks #3678
-
Commit: e7d8d3b
render
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 9.83ms - 11.61ms | - | unsure 🔍 -4% - +14% -0.42ms - +1.39ms | unsure 🔍 -5% - +13% -0.46ms - +1.34ms |
| tip-of-tree tip-of-tree | 10.10ms - 10.37ms | unsure 🔍 -13% - +4% -1.39ms - +0.42ms | - | unsure 🔍 -2% - +1% -0.25ms - +0.15ms |
| previous-release previous-release | 10.14ms - 10.42ms | unsure 🔍 -12% - +4% -1.34ms - +0.46ms | unsure 🔍 -1% - +2% -0.15ms - +0.25ms | - |
update
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 288.69ms - 291.98ms | - | unsure 🔍 -2% - +0% -6.25ms - +0.93ms | unsure 🔍 -0% - +1% -0.30ms - +3.99ms |
| tip-of-tree tip-of-tree | 289.81ms - 296.19ms | unsure 🔍 -0% - +2% -0.93ms - +6.25ms | - | slower ❌ 0% - 3% 1.03ms - 7.98ms |
| previous-release previous-release | 287.11ms - 289.87ms | unsure 🔍 -1% - +0% -3.99ms - +0.30ms | faster ✔ 0% - 3% 1.03ms - 7.98ms | - |
lit-html-template-heavy
- Browser: chrome-headless 104.0.5112.79
- Sample size: 50
- Built by: Benchmarks #3678
-
Commit: e7d8d3b
render
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 52.63ms - 53.32ms | - | unsure 🔍 -1% - +1% -0.58ms - +0.49ms | unsure 🔍 -1% - +0% -0.72ms - +0.23ms |
| tip-of-tree tip-of-tree | 52.61ms - 53.43ms | unsure 🔍 -1% - +1% -0.49ms - +0.58ms | - | unsure 🔍 -1% - +1% -0.72ms - +0.32ms |
| previous-release previous-release | 52.90ms - 53.55ms | unsure 🔍 -0% - +1% -0.23ms - +0.72ms | unsure 🔍 -1% - +1% -0.32ms - +0.72ms | - |
update
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 113.50ms - 115.08ms | - | unsure 🔍 -1% - +1% -1.45ms - +1.02ms | unsure 🔍 -2% - +0% -2.41ms - +0.08ms |
| tip-of-tree tip-of-tree | 113.56ms - 115.45ms | unsure 🔍 -1% - +1% -1.02ms - +1.45ms | - | unsure 🔍 -2% - +0% -2.30ms - +0.40ms |
| previous-release previous-release | 114.49ms - 116.41ms | unsure 🔍 -0% - +2% -0.08ms - +2.41ms | unsure 🔍 -0% - +2% -0.40ms - +2.30ms | - |
reactive-element-list
- Browser: chrome-headless 104.0.5112.79
- Sample size: 50
- Built by: Benchmarks #3678
-
Commit: e7d8d3b
render
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 55.75ms - 57.04ms | - | unsure 🔍 -0% - +3% -0.09ms - +1.75ms | unsure 🔍 -2% - +2% -1.07ms - +0.86ms |
| tip-of-tree tip-of-tree | 54.92ms - 56.21ms | unsure 🔍 -3% - +0% -1.75ms - +0.09ms | - | unsure 🔍 -3% - +0% -1.91ms - +0.03ms |
| previous-release previous-release | 55.79ms - 57.22ms | unsure 🔍 -2% - +2% -0.86ms - +1.07ms | unsure 🔍 -0% - +3% -0.03ms - +1.91ms | - |
update
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 808.94ms - 818.46ms | - | unsure 🔍 -1% - +1% -5.73ms - +7.08ms | unsure 🔍 -2% - +0% -12.90ms - +1.20ms |
| tip-of-tree tip-of-tree | 808.74ms - 817.31ms | unsure 🔍 -1% - +1% -7.08ms - +5.73ms | - | unsure 🔍 -2% - +0% -13.27ms - +0.22ms |
| previous-release previous-release | 814.35ms - 824.75ms | unsure 🔍 -0% - +2% -1.20ms - +12.90ms | unsure 🔍 -0% - +2% -0.22ms - +13.27ms | - |
update-reflect
| Version | Avg time | vs this-change | vs tip-of-tree tip-of-tree | vs previous-release previous-release |
|---|---|---|---|---|
| this-change | 905.77ms - 928.87ms | - | unsure 🔍 -0% - +4% -4.29ms - +32.15ms | unsure 🔍 -2% - +2% -19.52ms - +16.04ms |
| tip-of-tree tip-of-tree | 889.31ms - 917.48ms | unsure 🔍 -3% - +0% -32.15ms - +4.29ms | - | unsure 🔍 -4% - +0% -35.19ms - +3.86ms |
| previous-release previous-release | 905.54ms - 932.58ms | unsure 🔍 -2% - +2% -16.04ms - +19.52ms | unsure 🔍 -0% - +4% -3.86ms - +35.19ms | - |
closing because this PR became very aesthetic and that's not what i was aiming for. The logic for updates is fine :) just wanted it to read a little easier. But the changes increase code size and doesn't improve readability as much as I'd like.