un-ts / synckit

Perform async work synchronously in Node.js using `worker_threads` with first-class TypeScript and Yarn P'n'P support.
https://npm.im/synckit
MIT License
192 stars 11 forks source link

chore: add `make-synchronized` to benchmark test #160

Closed fisker closed 9 months ago

fisker commented 9 months ago

I don't really care about the load/initialize time, but will be nice to have data here.

changeset-bot[bot] commented 9 months ago

⚠️ No Changeset found

Latest commit: 84c5a188bb2c738fdd35d78db804ee853e0ef76e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

codesandbox-ci[bot] commented 9 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (69b8dcd) 100.00% compared to head (84c5a18) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #160 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 1 1 Lines 203 203 Branches 101 101 ========================================= Hits 203 203 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

JounQin commented 9 months ago

Thanks for the great make-synchronized package! I may refactor the public API accordingly.

JounQin commented 9 months ago

On Ubuntu:

┌───────────┬────────────┬──────────────┬───────────────────┬─────────────┬─────────────────┬───────────────────┬────────────────────────┬───────────┬─────────────────┐
│  (index)  │  synckit   │ sync-threads │ perf sync-threads │   deasync   │  perf deasync   │ make-synchronized │ perf make-synchronized │  native   │   perf native   │
├───────────┼────────────┼──────────────┼───────────────────┼─────────────┼─────────────────┼───────────────────┼────────────────────────┼───────────┼─────────────────┤
│ loadTime  │  '9.69ms'  │   '0.99ms'   │  '9.76x slower'   │  '23.67ms'  │ '2.44x faster'  │    '223.27ms'     │    '23.05x faster'     │ '0.55ms'  │ '17.55x slower' │
│  runTime  │ '229.52ms' │ '21238.44ms' │  '92.54x faster'  │ '8203.62ms' │ '35.74x faster' │    '3932.52ms'    │    '17.13x faster'     │ '17.45ms' │ '13.15x slower' │
│ totalTime │ '239.21ms' │ '21239.43ms' │  '88.79x faster'  │ '8227.29ms' │ '34.39x faster' │    '4155.79ms'    │    '17.37x faster'     │ '18.00ms' │ '13.29x slower' │
└───────────┴────────────┴──────────────┴───────────────────┴─────────────┴─────────────────┴───────────────────┴────────────────────────┴───────────┴─────────────────┘
┌───────────┬────────────┬──────────────┬───────────────────┬─────────────┬─────────────────┬───────────────────┬────────────────────────┬───────────┬─────────────────┐
│  (index)  │  synckit   │ sync-threads │ perf sync-threads │   deasync   │  perf deasync   │ make-synchronized │ perf make-synchronized │  native   │   perf native   │
├───────────┼────────────┼──────────────┼───────────────────┼─────────────┼─────────────────┼───────────────────┼────────────────────────┼───────────┼─────────────────┤
│ loadTime  │ '21.56ms'  │   '1.49ms'   │  '14.50x slower'  │  '41.00ms'  │ '1.90x faster'  │     '44.66ms'     │     '2.07x faster'     │ '0.65ms'  │ '32.99x slower' │
│  runTime  │ '266.85ms' │ '20633.65ms' │  '77.32x faster'  │ '4399.59ms' │ '16.49x faster' │    '7973.64ms'    │    '29.88x faster'     │ '18.39ms' │ '14.51x slower' │
│ totalTime │ '288.41ms' │ '20635.13ms' │  '71.55x faster'  │ '4440.59ms' │ '15.40x faster' │    '8018.29ms'    │    '27.80x faster'     │ '19.04ms' │ '15.15x slower' │
└───────────┴────────────┴──────────────┴───────────────────┴─────────────┴─────────────────┴───────────────────┴────────────────────────┴───────────┴─────────────────┘