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

refactor: simplify the logic introduced in #4322 #4323

Closed
wants to merge 1 commit into from
Closed

refactor: simplify the logic introduced in #4322 #4323

wants to merge 1 commit into from

Conversation

jviide
Copy link
Contributor

@jviide jviide commented Mar 23, 2024

This pull request simplifies the logic introduced in #4322. A separate state variable makes tracking eventClock increments more straightforward, uses the available range of integers more efficiently and makes build artifacts (except for one) smaller.

Copy link

github-actions bot commented Mar 23, 2024

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -2% - +1% (-1.87ms - +0.72ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -4% - +3% (-1.47ms - +1.10ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -1% - +0% (-8.57ms - +4.12ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -1% - +0% (-0.24ms - +0.06ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -1% - +1% (-0.50ms - +0.64ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -1% - +1% (-0.18ms - +0.21ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -3% - +2% (-0.07ms - +0.06ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +0% (-0.50ms - +0.12ms)
    preact-local vs preact-main

usedJSHeapSize

  • 02_replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.01ms - +0.01ms)
    preact-local vs preact-main
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter_list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • many_updates: unsure 🔍 -0% - -0% (-0.01ms - -0.00ms)
    preact-local vs preact-main
  • text_update: unsure 🔍 -1% - +2% (-0.00ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - -0% (-0.00ms - -0.00ms)
    preact-local vs preact-main

Results

02_replace1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main74.53ms - 76.36ms-unsure 🔍
-1% - +3%
-0.72ms - +1.87ms
unsure 🔍
-2% - +1%
-1.68ms - +0.56ms
preact-local73.95ms - 75.78msunsure 🔍
-2% - +1%
-1.87ms - +0.72ms
-faster ✔
0% - 3%
0.02ms - 2.26ms
preact-hooks75.36ms - 76.65msunsure 🔍
-1% - +2%
-0.56ms - +1.68ms
slower ❌
0% - 3%
0.02ms - 2.26ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.38ms - 3.39ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
0% - 1%
0.01ms - 0.02ms
preact-local3.38ms - 3.39msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
0% - 1%
0.01ms - 0.02ms
preact-hooks3.40ms - 3.41msslower ❌
0% - 1%
0.01ms - 0.02ms
slower ❌
0% - 1%
0.01ms - 0.02ms
-

run-warmup-0

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main29.24ms - 29.97ms-unsure 🔍
-1% - +2%
-0.33ms - +0.65ms
unsure 🔍
-3% - +0%
-0.89ms - +0.11ms
preact-local29.11ms - 29.78msunsure 🔍
-2% - +1%
-0.65ms - +0.33ms
-faster ✔
0% - 3%
0.07ms - 1.03ms
preact-hooks29.65ms - 30.34msunsure 🔍
-0% - +3%
-0.11ms - +0.89ms
slower ❌
0% - 4%
0.07ms - 1.03ms
-

run-warmup-1

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main38.86ms - 40.53ms-unsure 🔍
-2% - +3%
-0.89ms - +1.35ms
unsure 🔍
-4% - +0%
-1.80ms - +0.13ms
preact-local38.72ms - 40.21msunsure 🔍
-3% - +2%
-1.35ms - +0.89ms
-faster ✔
0% - 5%
0.17ms - 1.97ms
preact-hooks40.04ms - 41.03msunsure 🔍
-0% - +5%
-0.13ms - +1.80ms
slower ❌
0% - 5%
0.17ms - 1.97ms
-

run-warmup-2

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.02ms - 26.33ms-unsure 🔍
-1% - +1%
-0.24ms - +0.22ms
unsure 🔍
-0% - +2%
-0.02ms - +0.42ms
preact-local26.02ms - 26.35msunsure 🔍
-1% - +1%
-0.22ms - +0.24ms
-unsure 🔍
-0% - +2%
-0.01ms - +0.44ms
preact-hooks25.82ms - 26.13msunsure 🔍
-2% - +0%
-0.42ms - +0.02ms
unsure 🔍
-2% - +0%
-0.44ms - +0.01ms
-

run-warmup-3

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main24.29ms - 25.28ms-unsure 🔍
-3% - +3%
-0.74ms - +0.68ms
unsure 🔍
-3% - +4%
-0.67ms - +0.92ms
preact-local24.31ms - 25.32msunsure 🔍
-3% - +3%
-0.68ms - +0.74ms
-unsure 🔍
-3% - +4%
-0.65ms - +0.95ms
preact-hooks24.05ms - 25.28msunsure 🔍
-4% - +3%
-0.92ms - +0.67ms
unsure 🔍
-4% - +3%
-0.95ms - +0.65ms
-

run-warmup-4

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main25.15ms - 26.22ms-unsure 🔍
-1% - +5%
-0.32ms - +1.19ms
unsure 🔍
-5% - +1%
-1.19ms - +0.29ms
preact-local24.72ms - 25.78msunsure 🔍
-5% - +1%
-1.19ms - +0.32ms
-faster ✔
1% - 6%
0.15ms - 1.62ms
preact-hooks25.62ms - 26.65msunsure 🔍
-1% - +5%
-0.29ms - +1.19ms
slower ❌
1% - 6%
0.15ms - 1.62ms
-

run-final

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main22.62ms - 23.31ms-unsure 🔍
-0% - +4%
-0.04ms - +0.89ms
faster ✔
3% - 7%
0.63ms - 1.82ms
preact-local22.22ms - 22.85msunsure 🔍
-4% - +0%
-0.89ms - +0.04ms
-faster ✔
5% - 9%
1.08ms - 2.23ms
preact-hooks23.71ms - 24.68msslower ❌
3% - 8%
0.63ms - 1.82ms
slower ❌
5% - 10%
1.08ms - 2.23ms
-
03_update10th1k_x16

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main34.82ms - 36.58ms-unsure 🔍
-3% - +4%
-1.10ms - +1.47ms
unsure 🔍
-4% - +3%
-1.36ms - +1.12ms
preact-local34.58ms - 36.46msunsure 🔍
-4% - +3%
-1.47ms - +1.10ms
-unsure 🔍
-4% - +3%
-1.59ms - +0.99ms
preact-hooks34.94ms - 36.70msunsure 🔍
-3% - +4%
-1.12ms - +1.36ms
unsure 🔍
-3% - +4%
-0.99ms - +1.59ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main3.35ms - 3.36ms-unsure 🔍
-0% - +0%
-0.01ms - +0.01ms
faster ✔
0% - 1%
0.02ms - 0.03ms
preact-local3.35ms - 3.36msunsure 🔍
-0% - +0%
-0.01ms - +0.01ms
-faster ✔
0% - 1%
0.02ms - 0.03ms
preact-hooks3.37ms - 3.38msslower ❌
0% - 1%
0.02ms - 0.03ms
slower ❌
0% - 1%
0.02ms - 0.03ms
-
07_create10k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main886.11ms - 897.74ms-unsure 🔍
-0% - +1%
-4.12ms - +8.57ms
unsure 🔍
-1% - +1%
-10.96ms - +4.87ms
preact-local887.16ms - 892.23msunsure 🔍
-1% - +0%
-8.57ms - +4.12ms
-unsure 🔍
-1% - +0%
-11.20ms - +0.67ms
preact-hooks889.60ms - 900.33msunsure 🔍
-1% - +1%
-4.87ms - +10.96ms
unsure 🔍
-0% - +1%
-0.67ms - +11.20ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.16ms - 26.16ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local26.16ms - 26.16msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-hooks26.18ms - 26.18msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
unsure 🔍
+0% - +0%
+0.02ms - +0.02ms
-
filter_list

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main16.52ms - 16.81ms-unsure 🔍
-0% - +1%
-0.06ms - +0.24ms
unsure 🔍
-1% - +1%
-0.10ms - +0.21ms
preact-local16.56ms - 16.60msunsure 🔍
-1% - +0%
-0.24ms - +0.06ms
-unsure 🔍
-0% - +0%
-0.08ms - +0.01ms
preact-hooks16.57ms - 16.65msunsure 🔍
-1% - +1%
-0.21ms - +0.10ms
unsure 🔍
-0% - +0%
-0.01ms - +0.08ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main1.42ms - 1.42ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
faster ✔
1% - 2%
0.02ms - 0.03ms
preact-local1.42ms - 1.42msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-faster ✔
2% - 2%
0.02ms - 0.03ms
preact-hooks1.44ms - 1.45msslower ❌
1% - 2%
0.02ms - 0.03ms
slower ❌
2% - 2%
0.02ms - 0.03ms
-
hydrate1k

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main73.92ms - 74.75ms-unsure 🔍
-1% - +1%
-0.64ms - +0.50ms
unsure 🔍
-2% - +1%
-1.56ms - +0.41ms
preact-local74.01ms - 74.80msunsure 🔍
-1% - +1%
-0.50ms - +0.64ms
-unsure 🔍
-2% - +1%
-1.49ms - +0.47ms
preact-hooks74.01ms - 75.81msunsure 🔍
-1% - +2%
-0.41ms - +1.56ms
unsure 🔍
-1% - +2%
-0.47ms - +1.49ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main6.05ms - 6.05ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-local6.05ms - 6.05msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-unsure 🔍
-0% - -0%
-0.03ms - -0.02ms
preact-hooks6.07ms - 6.07msunsure 🔍
+0% - +0%
+0.02ms - +0.03ms
unsure 🔍
+0% - +0%
+0.02ms - +0.03ms
-
many_updates

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main16.52ms - 16.75ms-unsure 🔍
-1% - +1%
-0.21ms - +0.18ms
unsure 🔍
-2% - +1%
-0.39ms - +0.16ms
preact-local16.49ms - 16.80msunsure 🔍
-1% - +1%
-0.18ms - +0.21ms
-unsure 🔍
-2% - +1%
-0.40ms - +0.19ms
preact-hooks16.50ms - 17.00msunsure 🔍
-1% - +2%
-0.16ms - +0.39ms
unsure 🔍
-1% - +2%
-0.19ms - +0.40ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main4.52ms - 4.53ms-unsure 🔍
+0% - +0%
+0.00ms - +0.01ms
unsure 🔍
-0% - -0%
-0.02ms - -0.02ms
preact-local4.52ms - 4.52msunsure 🔍
-0% - -0%
-0.01ms - -0.00ms
-faster ✔
0% - 1%
0.02ms - 0.02ms
preact-hooks4.54ms - 4.55msunsure 🔍
+0% - +0%
+0.02ms - +0.02ms
slower ❌
0% - 1%
0.02ms - 0.02ms
-
text_update

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main2.43ms - 2.53ms-unsure 🔍
-2% - +3%
-0.06ms - +0.07ms
faster ✔
5% - 11%
0.14ms - 0.29ms
preact-local2.43ms - 2.52msunsure 🔍
-3% - +2%
-0.07ms - +0.06ms
-faster ✔
6% - 11%
0.15ms - 0.29ms
preact-hooks2.64ms - 2.74msslower ❌
6% - 12%
0.14ms - 0.29ms
slower ❌
6% - 12%
0.15ms - 0.29ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.80ms - 0.80ms-unsure 🔍
-2% - +1%
-0.01ms - +0.00ms
faster ✔
2% - 4%
0.02ms - 0.04ms
preact-local0.80ms - 0.82msunsure 🔍
-1% - +2%
-0.00ms - +0.01ms
-faster ✔
1% - 4%
0.01ms - 0.04ms
preact-hooks0.82ms - 0.84msslower ❌
2% - 5%
0.02ms - 0.04ms
slower ❌
1% - 4%
0.01ms - 0.04ms
-
todo

duration

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main26.31ms - 26.81ms-unsure 🔍
-0% - +2%
-0.12ms - +0.50ms
faster ✔
2% - 4%
0.47ms - 1.00ms
preact-local26.20ms - 26.55msunsure 🔍
-2% - +0%
-0.50ms - +0.12ms
-faster ✔
3% - 4%
0.72ms - 1.13ms
preact-hooks27.20ms - 27.39msslower ❌
2% - 4%
0.47ms - 1.00ms
slower ❌
3% - 4%
0.72ms - 1.13ms
-

usedJSHeapSize

VersionAvg timevs preact-mainvs preact-localvs preact-hooks
preact-main0.88ms - 0.88ms-unsure 🔍
+0% - +0%
+0.00ms - +0.00ms
faster ✔
3% - 3%
0.03ms - 0.03ms
preact-local0.88ms - 0.88msunsure 🔍
-0% - -0%
-0.00ms - -0.00ms
-faster ✔
3% - 3%
0.03ms - 0.03ms
preact-hooks0.91ms - 0.91msslower ❌
3% - 3%
0.03ms - 0.03ms
slower ❌
3% - 3%
0.03ms - 0.03ms
-

tachometer-reporter-action v2 for Benchmarks

@coveralls
Copy link

Coverage Status

coverage: 99.469%. remained the same
when pulling ccc3fbf on jviide:event-clock
into b1d1b87 on preactjs:main.

@coveralls
Copy link

Coverage Status

coverage: 99.469%. remained the same
when pulling ccc3fbf on jviide:event-clock
into b1d1b87 on preactjs:main.

@jviide jviide closed this Mar 24, 2024
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.

3 participants