preact
preact copied to clipboard
Use queueMicrotask for scheduling
By suggestion from @ mathiasbynens https://mobile.twitter.com/mathias/status/1229142133904478209 🎉
Size -11 B
🙌
Size Change: +1.42 kB (3%)
Total Size: 41.9 kB
Filename | Size | Change | |
---|---|---|---|
compat/dist/compat.js |
3.39 kB | +253 B (7%) | 🔍 |
compat/dist/compat.module.js |
3.38 kB | +221 B (6%) | 🔍 |
compat/dist/compat.umd.js |
3.44 kB | +249 B (7%) | 🔍 |
debug/dist/debug.js |
2.99 kB | -5 B (0%) | |
debug/dist/debug.module.js |
2.98 kB | +4 B (0%) | |
debug/dist/debug.umd.js |
3.07 kB | -3 B (0%) | |
devtools/dist/devtools.js |
232 B | +47 B (20%) | 🚨 |
devtools/dist/devtools.module.js |
241 B | +47 B (19%) | ⚠️ |
devtools/dist/devtools.umd.js |
308 B | +48 B (15%) | ⚠️ |
dist/preact.js |
3.97 kB | +108 B (2%) | |
dist/preact.min.js |
3.99 kB | +133 B (3%) | |
dist/preact.module.js |
3.99 kB | +107 B (2%) | |
dist/preact.umd.js |
4.03 kB | +118 B (2%) | |
hooks/dist/hooks.js |
1.13 kB | +29 B (2%) | |
hooks/dist/hooks.module.js |
1.15 kB | +30 B (2%) | |
hooks/dist/hooks.umd.js |
1.2 kB | +35 B (2%) |
ℹ️ View Unchanged
Filename | Size | Change | |
---|---|---|---|
jsx-runtime/dist/jsxRuntime.js |
317 B | 0 B | |
jsx-runtime/dist/jsxRuntime.module.js |
327 B | 0 B | |
jsx-runtime/dist/jsxRuntime.umd.js |
395 B | 0 B | |
test-utils/dist/testUtils.js |
437 B | 0 B | |
test-utils/dist/testUtils.module.js |
439 B | 0 B | |
test-utils/dist/testUtils.umd.js |
515 B | 0 B |
This seems to have low browser compat though https://caniuse.com/#search=queueMicrotask (11% diff to Promise)
Coverage decreased (-0.2%) to 99.622% when pulling c2fa8fa0eb37e441e9ec7351dc6ce1612c7d7bd3 on queue-microtask into 2b7397a5911fec88bd74bd362be5f9ab25165169 on master.
Good point. The data seems to be incorrect about edge though. The latest version does haver queueMicrotask
available.
Would love to get performance numbers for this change. The size decrease is awesome, but we'll want to be confident about the perf of this (and of setTimeout fallback in Edge <= 18) to merge.
We're hesitant to make the switch right now as that would push a lot of browsers over to setTimeout
. We'll revisit this in the future when the browserlandscape has changed a bit 👍
📊 Tachometer Benchmark Results
Summary
duration
- 02_replace1k: unsure 🔍 -1% - +3% (-1.61ms - +3.32ms)
preact-local vs preact-master - 03_update10th1k_x16: unsure 🔍 -4% - +5% (-1.47ms - +1.64ms)
preact-local vs preact-master - 07_create10k: unsure 🔍 -0% - +0% (-3.27ms - +2.84ms)
preact-local vs preact-master - filter_list: unsure 🔍 -2% - +2% (-0.33ms - +0.44ms)
preact-local vs preact-master - hydrate1k: unsure 🔍 -4% - +1% (-5.06ms - +1.72ms)
preact-local vs preact-master - many_updates: unsure 🔍 -2% - +6% (-0.73ms - +2.27ms)
preact-local vs preact-master - text_update: unsure 🔍 -2% - +5% (-0.06ms - +0.19ms)
preact-local vs preact-master
usedJSHeapSize
- 02_replace1k: unsure 🔍 -1% - +0% (-0.02ms - +0.01ms)
preact-local vs preact-master - 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.01ms - +0.02ms)
preact-local vs preact-master - 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
preact-local vs preact-master - filter_list: unsure 🔍 -1% - +3% (-0.01ms - +0.05ms)
preact-local vs preact-master - hydrate1k: unsure 🔍 -1% - +0% (-0.07ms - +0.02ms)
preact-local vs preact-master - many_updates: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
preact-local vs preact-master - text_update: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
preact-local vs preact-master
Results
02_replace1k
- Browser: chrome-headless 90.0.4430.212
- Sample size: 80
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 128.90ms - 132.65ms | - | unsure 🔍 -3% - +1% -3.32ms - +1.61ms |
preact-local | 130.03ms - 133.24ms | unsure 🔍 -1% - +3% -1.61ms - +3.32ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 3.55ms - 3.58ms | - | unsure 🔍 -0% - +1% -0.01ms - +0.02ms |
preact-local | 3.55ms - 3.57ms | unsure 🔍 -1% - +0% -0.02ms - +0.01ms | - |
run-warmup-0
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 52.89ms - 53.64ms | - | unsure 🔍 -0% - +2% -0.25ms - +0.80ms |
preact-local | 52.62ms - 53.36ms | unsure 🔍 -2% - +0% -0.80ms - +0.25ms | - |
run-warmup-1
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 85.76ms - 87.13ms | - | unsure 🔍 -1% - +1% -1.01ms - +0.72ms |
preact-local | 86.06ms - 87.12ms | unsure 🔍 -1% - +1% -0.72ms - +1.01ms | - |
run-warmup-2
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 75.74ms - 83.93ms | - | unsure 🔍 -10% - +4% -7.88ms - +3.50ms |
preact-local | 78.08ms - 85.97ms | unsure 🔍 -4% - +10% -3.50ms - +7.88ms | - |
run-warmup-3
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 59.42ms - 67.77ms | - | unsure 🔍 -1% - +17% -0.59ms - +10.11ms |
preact-local | 55.50ms - 62.17ms | unsure 🔍 -16% - +1% -10.11ms - +0.59ms | - |
run-warmup-4
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 81.48ms - 84.86ms | - | faster ✔ 0% - 5% 0.18ms - 4.49ms |
preact-local | 84.17ms - 86.84ms | slower ❌ 0% - 5% 0.18ms - 4.49ms | - |
run-final
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 50.46ms - 53.24ms | - | unsure 🔍 -4% - +4% -1.85ms - +1.95ms |
preact-local | 50.50ms - 53.09ms | unsure 🔍 -4% - +4% -1.95ms - +1.85ms | - |
03_update10th1k_x16
- Browser: chrome-headless 90.0.4430.212
- Sample size: 110
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 34.46ms - 36.70ms | - | unsure 🔍 -5% - +4% -1.64ms - +1.47ms |
preact-local | 34.58ms - 36.75ms | unsure 🔍 -4% - +5% -1.47ms - +1.64ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 3.57ms - 3.59ms | - | unsure 🔍 -0% - +0% -0.02ms - +0.01ms |
preact-local | 3.58ms - 3.60ms | unsure 🔍 -0% - +0% -0.01ms - +0.02ms | - |
07_create10k
- Browser: chrome-headless 90.0.4430.212
- Sample size: 50
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 1249.06ms - 1253.01ms | - | unsure 🔍 -0% - +0% -2.84ms - +3.27ms |
preact-local | 1248.50ms - 1253.15ms | unsure 🔍 -0% - +0% -3.27ms - +2.84ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 25.38ms - 25.38ms | - | unsure 🔍 -0% - +0% -0.00ms - +0.00ms |
preact-local | 25.38ms - 25.38ms | unsure 🔍 -0% - +0% -0.00ms - +0.00ms | - |
filter_list
- Browser: chrome-headless 90.0.4430.212
- Sample size: 50
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 21.52ms - 21.93ms | - | unsure 🔍 -2% - +2% -0.44ms - +0.33ms |
preact-local | 21.45ms - 22.11ms | unsure 🔍 -2% - +2% -0.33ms - +0.44ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 1.64ms - 1.69ms | - | unsure 🔍 -3% - +1% -0.05ms - +0.01ms |
preact-local | 1.66ms - 1.71ms | unsure 🔍 -1% - +3% -0.01ms - +0.05ms | - |
hydrate1k
- Browser: chrome-headless 90.0.4430.212
- Sample size: 50
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 115.04ms - 119.90ms | - | unsure 🔍 -2% - +4% -1.72ms - +5.06ms |
preact-local | 113.44ms - 118.16ms | unsure 🔍 -4% - +1% -5.06ms - +1.72ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 6.29ms - 6.35ms | - | unsure 🔍 -0% - +1% -0.02ms - +0.07ms |
preact-local | 6.27ms - 6.33ms | unsure 🔍 -1% - +0% -0.07ms - +0.02ms | - |
many_updates
- Browser: chrome-headless 90.0.4430.212
- Sample size: 80
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 35.15ms - 37.16ms | - | unsure 🔍 -6% - +2% -2.27ms - +0.73ms |
preact-local | 35.81ms - 38.04ms | unsure 🔍 -2% - +6% -0.73ms - +2.27ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 4.65ms - 4.67ms | - | unsure 🔍 -0% - +0% -0.01ms - +0.01ms |
preact-local | 4.65ms - 4.67ms | unsure 🔍 -0% - +0% -0.01ms - +0.01ms | - |
text_update
- Browser: chrome-headless 90.0.4430.212
- Sample size: 190
- Built by: Benchmarks #300
-
Commit: c2fa8fa
duration
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 3.72ms - 3.85ms | - | unsure 🔍 -5% - +1% -0.19ms - +0.06ms |
preact-local | 3.74ms - 3.95ms | unsure 🔍 -2% - +5% -0.06ms - +0.19ms | - |
usedJSHeapSize
Version | Avg time | vs preact-master | vs preact-local |
---|---|---|---|
preact-master | 0.83ms - 0.83ms | - | unsure 🔍 +0% - +0% +0.00ms - +0.00ms |
preact-local | 0.83ms - 0.83ms | unsure 🔍 -0% - -0% -0.00ms - -0.00ms | - |