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

Various perf and size improvements #3704

Merged
merged 7 commits into from
Sep 3, 2022
Merged

Various perf and size improvements #3704

merged 7 commits into from
Sep 3, 2022

Conversation

JoviDeCroock
Copy link
Member

@JoviDeCroock JoviDeCroock commented Sep 2, 2022

  • shorter functions for easy optimization
  • getting rid of rendererState
  • make mount and patch component more inline

@github-actions
Copy link

github-actions bot commented Sep 2, 2022

Size Change: -338 B (0%)

Total Size: 37.4 kB

Filename Size Change
dist/preact.js 4.46 kB -121 B (2%)
dist/preact.min.js 4.51 kB -123 B (2%)
dist/preact.umd.js 4.56 kB -94 B (2%)
ℹ️ View Unchanged
Filename Size Change
compat/dist/compat.js 3.51 kB 0 B
compat/dist/compat.umd.js 3.58 kB 0 B
debug/dist/debug.js 3.08 kB 0 B
debug/dist/debug.umd.js 3.17 kB 0 B
devtools/dist/devtools.js 232 B 0 B
devtools/dist/devtools.umd.js 316 B 0 B
hooks/dist/hooks.js 1.45 kB 0 B
hooks/dist/hooks.umd.js 1.54 kB 0 B
jsx-runtime/dist/jsxRuntime.js 342 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 425 B 0 B
server/dist/server.js 2.6 kB 0 B
server/dist/server.umd.js 2.69 kB 0 B
test-utils/dist/testUtils.js 437 B 0 B
test-utils/dist/testUtils.umd.js 522 B 0 B

compressed-size-action

@coveralls
Copy link

coveralls commented Sep 2, 2022

Coverage Status

Coverage decreased (-0.01%) to 99.428% when pulling ccae84a on test-perf-stuff into aa8d57b on v11.

src/component.js Outdated Show resolved Hide resolved
@preactjs preactjs deleted a comment from github-actions bot Sep 2, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

📊 Tachometer Benchmark Results

Summary

duration

  • 03_update10th1k_x16: faster ✔ 0% - 10% (0.01ms - 0.53ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +1% (-6.15ms - +9.90ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -1% - +1% (-3.69ms - +3.30ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -12% - +5% (-15.83ms - +5.94ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -4% - +1% (-10.22ms - +4.01ms)
    preact-local vs preact-master
  • text_update: faster ✔ 2% - 3% (1.01ms - 1.67ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -5% - +1% (-2.21ms - +0.66ms)
    preact-local vs preact-master

usedJSHeapSize

  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.07ms - +0.09ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -0% - -0% (-0.01ms - -0.00ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - -0% (-0.01ms - -0.00ms)
    preact-local vs preact-master
  • text_update: faster ✔ 1% - 1% (0.01ms - 0.01ms)
    preact-local vs preact-master
  • todo: unsure 🔍 -1% - +2% (-0.02ms - +0.03ms)
    preact-local vs preact-master

Results

03_update10th1k_x16

duration

VersionAvg timevs preact-mastervs preact-local
preact-master5.12ms - 5.48ms-slower ❌
0% - 11%
0.01ms - 0.53ms
preact-local4.85ms - 5.22msfaster ✔
0% - 10%
0.01ms - 0.53ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.21ms - 4.23ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
preact-local4.21ms - 4.23msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-
07_create10k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1281.16ms - 1292.63ms-unsure 🔍
-1% - +0%
-9.90ms - +6.15ms
preact-local1283.15ms - 1294.39msunsure 🔍
-0% - +1%
-6.15ms - +9.90ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master28.36ms - 28.48ms-unsure 🔍
-0% - +0%
-0.09ms - +0.07ms
preact-local28.38ms - 28.49msunsure 🔍
-0% - +0%
-0.07ms - +0.09ms
-
filter_list

duration

VersionAvg timevs preact-mastervs preact-local
preact-master268.18ms - 272.73ms-unsure 🔍
-1% - +1%
-3.30ms - +3.69ms
preact-local267.61ms - 272.91msunsure 🔍
-1% - +1%
-3.69ms - +3.30ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master2.14ms - 2.14ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local2.14ms - 2.14msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-mastervs preact-local
preact-master119.56ms - 134.36ms-unsure 🔍
-5% - +13%
-5.94ms - +15.83ms
preact-local114.03ms - 129.99msunsure 🔍
-12% - +5%
-15.83ms - +5.94ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.91ms - 6.91ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-local6.91ms - 6.91msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
many_updates

duration

VersionAvg timevs preact-mastervs preact-local
preact-master275.80ms - 286.27ms-unsure 🔍
-1% - +4%
-4.01ms - +10.22ms
preact-local273.11ms - 282.74msunsure 🔍
-4% - +1%
-10.22ms - +4.01ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master5.77ms - 5.77ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
preact-local5.76ms - 5.76msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-
text_update

duration

VersionAvg timevs preact-mastervs preact-local
preact-master48.38ms - 48.92ms-slower ❌
2% - 4%
1.01ms - 1.67ms
preact-local47.11ms - 47.51msfaster ✔
2% - 3%
1.01ms - 1.67ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.31ms - 1.31ms-slower ❌
1% - 1%
0.01ms - 0.01ms
preact-local1.30ms - 1.30msfaster ✔
1% - 1%
0.01ms - 0.01ms
-
todo

duration

VersionAvg timevs preact-mastervs preact-local
preact-master44.96ms - 47.07ms-unsure 🔍
-1% - +5%
-0.66ms - +2.21ms
preact-local44.26ms - 46.22msunsure 🔍
-5% - +1%
-2.21ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.36ms - 1.39ms-unsure 🔍
-2% - +1%
-0.03ms - +0.02ms
preact-local1.36ms - 1.40msunsure 🔍
-1% - +2%
-0.02ms - +0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@JoviDeCroock JoviDeCroock marked this pull request as ready for review September 2, 2022 10:59
@JoviDeCroock
Copy link
Member Author

4e31d42 seems to make filter_list ever so slightly slower as opposed to keeping it on the renderState I think this could be due to traversing the context upwards on a regular basis with patches

@JoviDeCroock JoviDeCroock changed the title Testing various perf optimizations Various perf and size improvements Sep 2, 2022
Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

This is great! Find it a little bit easier to read too without the property access stuff 💯

@JoviDeCroock JoviDeCroock merged commit 53621d9 into v11 Sep 3, 2022
@JoviDeCroock JoviDeCroock deleted the test-perf-stuff branch September 3, 2022 07:12
Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

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

Hell yeah

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.

4 participants