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

test: add reactivity benchmark #9638

Merged
merged 2 commits into from
Dec 8, 2023
Merged

test: add reactivity benchmark #9638

merged 2 commits into from
Dec 8, 2023

Conversation

sxzz
Copy link
Member

@sxzz sxzz commented Nov 20, 2023

Add benchmark integrated with CodSpeed and Vitest.

  • CODSPEED_TOKEN secret is required to config in GitHub actions

Thanks to https://github.com/basvanmeurs/vue-next-benchmarks

@sxzz sxzz changed the title benchmark test: add reactivity benchmark Nov 20, 2023
Copy link

github-actions bot commented Nov 20, 2023

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 87 kB 33.1 kB 29.9 kB
vue.global.prod.js 133 kB 49.9 kB 44.8 kB

Usages

Name Size Gzip Brotli
createApp 48.3 kB 19 kB 17.4 kB
createSSRApp 51.5 kB 20.3 kB 18.5 kB
defineCustomElement 50.7 kB 19.8 kB 18 kB
overall 61.7 kB 23.9 kB 21.7 kB

Copy link

codspeed-hq bot commented Nov 20, 2023

CodSpeed Performance Report

Congrats! CodSpeed is installed 🎉

🆕 53 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks

  • write reactive map, read computed (302.8 µs)
  • create reactive map (57.5 µs)
  • 1000 reactive maps, 1 computed (31.7 ms)
  • write reactive map, read 1000 computeds (48.6 ms)
  • write reactive map, don't read computed (never invoked) (62.1 µs)
  • create computed (37.8 µs)
  • write reactive map, don't read 1000 computeds (never invoked) (76.5 µs)
  • write reactive map (10'000 items), read computed (40.4 ms)
  • write reactive map, don't read 1000 computeds (invoked) (4.9 ms)
  • write reactive map, don't read computed (invoked) (178.3 µs)
  • write reactive map property (85.9 µs)
  • write independent ref dep (55.3 µs)
  • write ref, don't read computed (never invoked) (55.1 µs)
  • write ref, don't read computed (invoked) (123.1 µs)
  • write ref, read computed (286.2 µs)
  • write ref, don't read 1000 computeds (never invoked) (62.4 µs)
  • write reactive obj property (93.7 µs)
  • write ref, read 1000 computeds (29.7 ms)
  • write ref, don't read 1000 computeds (invoked) (3.4 ms)
  • 1000 refs, 1 computed (14.7 ms)
  • write reactive obj, don't read computed (invoked) (190.4 µs)
  • create reactive obj (50 µs)
  • write reactive obj, read computed (298.6 µs)
  • write reactive obj, don't read 1000 computeds (invoked) (3.5 ms)
  • write reactive obj, read 1000 computeds (39.5 ms)
  • write reactive obj, don't read 1000 computeds (never invoked) (123.7 µs)
  • write reactive obj, don't read computed (never invoked) (93.4 µs)
  • 1000 reactive objs, 1 computed (24.1 ms)
  • reduce *reactive* array, 10 elements (3.5 ms)
  • reduce *reactive* array, 10 elements, only change first value (657 µs)
  • reduce *readonly* array, 10 elements (1.8 ms)
  • reduce *raw* array, manually triggered, 10 elements (1.1 ms)
  • reduce *raw* array, copied, 10 elements (379.8 µs)
  • reduce *reactive* array, 100 elements (11.9 ms)
  • reduce *raw* array, copied, 100 elements (247.8 µs)
  • reduce *raw* array, manually triggered, 100 elements (288.6 µs)
  • reduce *reactive* array, 100 elements, only change first value (3.8 ms)
  • reduce *readonly* array, 100 elements (6.7 ms)
  • reduce *reactive* array, 1000 elements (123.1 ms)
  • reduce *reactive* array, 1000 elements, only change first value (35.4 ms)
  • reduce *readonly* array, 1000 elements (64 ms)
  • reduce *raw* array, copied, 1000 elements (952.6 µs)
  • update ref to trigger watcher (scheduled but not executed) (296.9 µs)
  • reduce *raw* array, manually triggered, 1000 elements (1.1 ms)
  • update ref to trigger watcher (executed) (1.6 ms)
  • update ref to trigger watchEffect (executed) (232.8 µs)
  • create watcher (231.5 µs)
  • update ref to trigger watchEffect (scheduled but not executed) (1.2 ms)
  • write ref (88 µs)
  • write/read ref (89.5 µs)
  • read ref (22 µs)
  • create ref (41.4 µs)
  • create watchEffect (107.1 µs)

@sxzz sxzz requested a review from yyx990803 December 8, 2023 10:16
@sxzz sxzz self-assigned this Dec 8, 2023
@yyx990803 yyx990803 merged commit b1fe48d into vuejs:main Dec 8, 2023
13 checks passed
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.

2 participants