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

Improve hydration tests #2899

Merged
merged 5 commits into from
Jan 2, 2021
Merged

Improve hydration tests #2899

merged 5 commits into from
Jan 2, 2021

Conversation

andrewiggins
Copy link
Member

Improve our hydration tests to actually assert what hydration should do: attach event listeners. Did this for normal and suspended hydration as well as fix a bug in our Suspense implementation of suspended hydration so these new tests pass.

@github-actions
Copy link

github-actions bot commented Jan 2, 2021

📊 Tachometer Benchmark Results

Summary

duration

  • 02_replace1k: unsure 🔍 -1% - +3% (-1.41ms - +5.16ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -1% - +6% (-0.41ms - +2.31ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -2% - +0% (-26.35ms - +6.11ms)
    preact-local vs preact-master
  • filter_list: unsure 🔍 -5% - +5% (-1.09ms - +1.16ms)
    preact-local vs preact-master
  • hydrate1k: unsure 🔍 -1% - +3% (-1.82ms - +4.44ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -9% - +6% (-3.09ms - +1.94ms)
    preact-local vs preact-master
  • text_update: unsure 🔍 -3% - +1% (-0.09ms - +0.05ms)
    preact-local vs preact-master

usedJSHeapSize

  • 02_replace1k: unsure 🔍 +0% - +0% (+0.00ms - +0.01ms)
    preact-local vs preact-master
  • 03_update10th1k_x16: unsure 🔍 -0% - +0% (-0.00ms - +0.01ms)
    preact-local vs preact-master
  • 07_create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    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.02ms)
    preact-local vs preact-master
  • many_updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    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 87.0.4280.88
  • Sample size: 80
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master149.50ms - 154.24ms-unsure 🔍
-3% - +1%
-5.16ms - +1.41ms
preact-local151.48ms - 156.01msunsure 🔍
-1% - +3%
-1.41ms - +5.16ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.60ms - 3.61ms-unsure 🔍
-0% - -0%
-0.01ms - -0.00ms
preact-local3.61ms - 3.62msunsure 🔍
+0% - +0%
+0.00ms - +0.01ms
-

run-warmup-0

VersionAvg timevs preact-mastervs preact-local
preact-master54.71ms - 56.47ms-unsure 🔍
-1% - +3%
-0.47ms - +1.90ms
preact-local54.08ms - 55.66msunsure 🔍
-3% - +1%
-1.90ms - +0.47ms
-

run-warmup-1

VersionAvg timevs preact-mastervs preact-local
preact-master86.20ms - 88.65ms-unsure 🔍
-3% - +1%
-2.64ms - +0.93ms
preact-local86.98ms - 89.58msunsure 🔍
-1% - +3%
-0.93ms - +2.64ms
-

run-warmup-2

VersionAvg timevs preact-mastervs preact-local
preact-master98.60ms - 101.91ms-unsure 🔍
-2% - +3%
-1.72ms - +2.87ms
preact-local98.09ms - 101.27msunsure 🔍
-3% - +2%
-2.87ms - +1.72ms
-

run-warmup-3

VersionAvg timevs preact-mastervs preact-local
preact-master54.83ms - 56.68ms-unsure 🔍
-1% - +3%
-0.64ms - +1.75ms
preact-local54.45ms - 55.95msunsure 🔍
-3% - +1%
-1.75ms - +0.64ms
-

run-warmup-4

VersionAvg timevs preact-mastervs preact-local
preact-master100.72ms - 105.98ms-unsure 🔍
-2% - +5%
-2.22ms - +5.54ms
preact-local98.83ms - 104.55msunsure 🔍
-5% - +2%
-5.54ms - +2.22ms
-

run-final

VersionAvg timevs preact-mastervs preact-local
preact-master53.64ms - 55.26ms-unsure 🔍
-3% - +1%
-1.78ms - +0.53ms
preact-local54.26ms - 55.89msunsure 🔍
-1% - +3%
-0.53ms - +1.78ms
-
03_update10th1k_x16
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 110
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master36.86ms - 38.82ms-unsure 🔍
-6% - +1%
-2.31ms - +0.41ms
preact-local37.85ms - 39.73msunsure 🔍
-1% - +6%
-0.41ms - +2.31ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master3.52ms - 3.53ms-unsure 🔍
-0% - +0%
-0.01ms - +0.00ms
preact-local3.53ms - 3.53msunsure 🔍
-0% - +0%
-0.00ms - +0.01ms
-
07_create10k
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master1468.70ms - 1490.76ms-unsure 🔍
-0% - +2%
-6.11ms - +26.35ms
preact-local1457.70ms - 1481.51msunsure 🔍
-2% - +0%
-26.35ms - +6.11ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master25.99ms - 25.99ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local25.99ms - 25.99msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter_list
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 70
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master23.16ms - 24.86ms-unsure 🔍
-5% - +5%
-1.16ms - +1.09ms
preact-local23.32ms - 24.78msunsure 🔍
-5% - +5%
-1.09ms - +1.16ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master1.60ms - 1.60ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local1.60ms - 1.60msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master135.65ms - 140.05ms-unsure 🔍
-3% - +1%
-4.44ms - +1.82ms
preact-local136.93ms - 141.39msunsure 🔍
-1% - +3%
-1.82ms - +4.44ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master6.19ms - 6.21ms-unsure 🔍
-0% - +0%
-0.02ms - +0.01ms
preact-local6.19ms - 6.22msunsure 🔍
-0% - +0%
-0.01ms - +0.02ms
-
many_updates
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 80
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master32.82ms - 36.42ms-unsure 🔍
-6% - +9%
-1.94ms - +3.09ms
preact-local32.29ms - 35.80msunsure 🔍
-9% - +6%
-3.09ms - +1.94ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master4.85ms - 4.85ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local4.85ms - 4.85msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
text_update
  • Browser: chrome-headless 87.0.4280.88
  • Sample size: 50
  • Built by: CI #645
  • Commit: 59635f4

duration

VersionAvg timevs preact-mastervs preact-local
preact-master3.57ms - 3.68ms-unsure 🔍
-1% - +3%
-0.05ms - +0.09ms
preact-local3.56ms - 3.65msunsure 🔍
-3% - +1%
-0.09ms - +0.05ms
-

usedJSHeapSize

VersionAvg timevs preact-mastervs preact-local
preact-master0.83ms - 0.83ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-local0.83ms - 0.83msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

tachometer-reporter-action v2 for CI

});
});

it.skip('should properly hydrate suspense when resolves to a Fragment', () => {
Copy link
Member Author

Choose a reason for hiding this comment

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

Currently not supported but I didn't realize that until after I wrote the tests so since I wrote it I figured I'd add it so that maybe one day we can enable it.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.002%) to 99.609% when pulling b0c44b8 on improve-hydration-tests into 1f9ed7a on master.

@github-actions
Copy link

github-actions bot commented Jan 2, 2021

Size Change: +12 B (0%)

Total Size: 41.6 kB

Filename Size Change
compat/dist/compat.js 3.23 kB +3 B (0%)
compat/dist/compat.module.js 3.25 kB +6 B (0%)
compat/dist/compat.umd.js 3.29 kB +3 B (0%)
ℹ️ View Unchanged
Filename Size Change
debug/dist/debug.js 2.99 kB 0 B
debug/dist/debug.module.js 2.98 kB 0 B
debug/dist/debug.umd.js 3.07 kB 0 B
devtools/dist/devtools.js 185 B 0 B
devtools/dist/devtools.module.js 195 B 0 B
devtools/dist/devtools.umd.js 261 B 0 B
dist/preact.js 4.03 kB 0 B
dist/preact.min.js 4.06 kB 0 B
dist/preact.module.js 4.05 kB 0 B
dist/preact.umd.js 4.1 kB 0 B
hooks/dist/hooks.js 1.13 kB 0 B
hooks/dist/hooks.module.js 1.15 kB 0 B
hooks/dist/hooks.umd.js 1.2 kB 0 B
jsx-runtime/dist/jsxRuntime.js 327 B 0 B
jsx-runtime/dist/jsxRuntime.module.js 335 B 0 B
jsx-runtime/dist/jsxRuntime.umd.js 405 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

compressed-size-action

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 awesome ⭐

@marvinhagemeister marvinhagemeister merged commit 09c2b8e into master Jan 2, 2021
@marvinhagemeister marvinhagemeister deleted the improve-hydration-tests branch January 2, 2021 17:47
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