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

major(core): test perf of skipping some lifecycle hooks for perf #4366

Open
wants to merge 1 commit into
base: breaking-changes-11
Choose a base branch
from

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Apr 30, 2024

The main thinking behind this is that we are accessing the _component megamorphic object less resulting in better performance.

This leaves four accessors behind

  • contextType - our provider is a functional component
  • shouldComponentUpdate - our provider component uses this
  • componentWillUnmount - our provider component uses this
  • componentDidUpdate - this is used in the useState hook

Copy link

github-actions bot commented Apr 30, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -3% - +0% (-22.77ms - +3.35ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -2% - +1% (-0.41ms - +0.11ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +1% (-1.75ms - +0.42ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -5% - +5% (-0.87ms - +0.90ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +2% (-0.98ms - +1.67ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +2% (-0.08ms - +0.03ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -3% - +1% (-0.74ms - +0.39ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +2% (-1.22ms - +0.52ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: faster ✔ 1% - 1% (0.40ms - 0.40ms)
    preact-local vs preact-main
  • filter-list: faster ✔ 2% - 2% (0.03ms - 0.04ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -4% - +1% (-0.65ms - +0.10ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +0% (-0.04ms - +0.02ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +5% (-0.05ms - +0.06ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-main
  • update10th1k: faster ✔ 1% - 1% (0.03ms - 0.03ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local877.65ms - 887.34ms-unsure 🔍
-3% - +0%
-22.77ms - +3.35ms
preact-main880.08ms - 904.34msunsure 🔍
-0% - +3%
-3.35ms - +22.77ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local26.35ms - 26.35ms-faster ✔
1% - 1%
0.40ms - 0.40ms
preact-main26.75ms - 26.75msslower ❌
2% - 2%
0.40ms - 0.40ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.75ms - 16.88ms-unsure 🔍
-2% - +1%
-0.41ms - +0.11ms
preact-main16.72ms - 17.22msunsure 🔍
-1% - +2%
-0.11ms - +0.41ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.71ms - 1.72ms-faster ✔
2% - 2%
0.03ms - 0.04ms
preact-main1.75ms - 1.76msslower ❌
2% - 2%
0.03ms - 0.04ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local75.33ms - 76.34ms-unsure 🔍
-2% - +1%
-1.75ms - +0.42ms
preact-main75.54ms - 77.46msunsure 🔍
-1% - +2%
-0.42ms - +1.75ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local13.93ms - 14.43ms-unsure 🔍
-4% - +1%
-0.65ms - +0.10ms
preact-main14.17ms - 14.73msunsure 🔍
-1% - +5%
-0.10ms - +0.65ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local17.48ms - 18.68ms-unsure 🔍
-5% - +5%
-0.87ms - +0.90ms
preact-main17.41ms - 18.72msunsure 🔍
-5% - +5%
-0.90ms - +0.87ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.86ms - 4.86ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main4.86ms - 4.86msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local76.97ms - 78.59ms-unsure 🔍
-1% - +2%
-0.98ms - +1.67ms
preact-main76.39ms - 78.48msunsure 🔍
-2% - +1%
-1.67ms - +0.98ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.66ms - 3.70ms-unsure 🔍
-1% - +0%
-0.04ms - +0.02ms
preact-main3.67ms - 3.71msunsure 🔍
-0% - +1%
-0.02ms - +0.04ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local28.86ms - 29.42ms-unsure 🔍
-1% - +2%
-0.41ms - +0.49ms
preact-main28.75ms - 29.45msunsure 🔍
-2% - +1%
-0.49ms - +0.41ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local38.18ms - 40.01ms-unsure 🔍
-1% - +5%
-0.50ms - +2.04ms
preact-main37.44ms - 39.21msunsure 🔍
-5% - +1%
-2.04ms - +0.50ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local27.29ms - 27.97ms-unsure 🔍
-0% - +3%
-0.04ms - +0.75ms
preact-main27.08ms - 27.48msunsure 🔍
-3% - +0%
-0.75ms - +0.04ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local25.10ms - 25.88ms-unsure 🔍
-2% - +2%
-0.53ms - +0.54ms
preact-main25.11ms - 25.85msunsure 🔍
-2% - +2%
-0.54ms - +0.53ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local27.44ms - 29.41ms-unsure 🔍
-7% - +4%
-2.01ms - +1.12ms
preact-main27.65ms - 30.08msunsure 🔍
-4% - +7%
-1.12ms - +2.01ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local24.12ms - 25.10ms-faster ✔
0% - 6%
0.01ms - 1.66ms
preact-main24.78ms - 26.10msslower ❌
0% - 7%
0.01ms - 1.66ms
-
text-update

duration

VersionAvg timevs preact-localvs preact-main
preact-local1.68ms - 1.76ms-unsure 🔍
-5% - +2%
-0.08ms - +0.03ms
preact-main1.71ms - 1.79msunsure 🔍
-2% - +5%
-0.03ms - +0.08ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.20ms - 1.27ms-unsure 🔍
-4% - +5%
-0.05ms - +0.06ms
preact-main1.19ms - 1.27msunsure 🔍
-5% - +4%
-0.06ms - +0.05ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local26.46ms - 27.55ms-unsure 🔍
-3% - +1%
-0.74ms - +0.39ms
preact-main27.03ms - 27.33msunsure 🔍
-1% - +3%
-0.39ms - +0.74ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.25ms - 1.25ms-unsure 🔍
-0% - -0%
-0.00ms - -0.00ms
preact-main1.25ms - 1.25msunsure 🔍
+0% - +0%
+0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local30.18ms - 30.94ms-unsure 🔍
-4% - +2%
-1.22ms - +0.52ms
preact-main30.12ms - 31.69msunsure 🔍
-2% - +4%
-0.52ms - +1.22ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.66ms - 3.66ms-faster ✔
1% - 1%
0.03ms - 0.03ms
preact-main3.69ms - 3.69msslower ❌
1% - 1%
0.03ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

Copy link

Size Change: +43 B (0%)

Total Size: 61.1 kB

Filename Size Change
dist/preact.js 4.62 kB +5 B (0%)
dist/preact.min.js 4.65 kB +8 B (0%)
dist/preact.min.module.js 4.65 kB +6 B (0%)
dist/preact.min.umd.js 4.68 kB +8 B (0%)
dist/preact.module.js 4.63 kB +7 B (0%)
dist/preact.umd.js 4.69 kB +9 B (0%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 4.09 kB 0 B
compat/dist/compat.module.js 4.01 kB 0 B
compat/dist/compat.umd.js 4.14 kB 0 B
debug/dist/debug.js 3.63 kB 0 B
debug/dist/debug.module.js 3.62 kB 0 B
debug/dist/debug.umd.js 3.71 kB 0 B
devtools/dist/devtools.js 231 B 0 B
devtools/dist/devtools.module.js 240 B 0 B
devtools/dist/devtools.umd.js 314 B 0 B
hooks/dist/hooks.js 1.55 kB 0 B
hooks/dist/hooks.module.js 1.59 kB 0 B
hooks/dist/hooks.umd.js 1.63 kB 0 B
jsx-runtime/dist/jsxRuntime.js 976 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 949 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 1.06 kB 0 B
test-utils/dist/testUtils.js 453 B 0 B
test-utils/dist/testUtils.module.js 454 B 0 B
test-utils/dist/testUtils.umd.js 536 B 0 B

compressed-size-action

@coveralls
Copy link

coveralls commented Apr 30, 2024

Coverage Status

coverage: 99.609%. remained the same
when pulling e86a0f4 on test-skipping-lifecycles-for-funcs
into a832512 on main.

@JoviDeCroock JoviDeCroock changed the base branch from main to breaking-changes-11 April 30, 2024 07:39
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

2 participants