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

Adding benchmarks #1

Merged
merged 5 commits into from
Sep 15, 2021
Merged

Adding benchmarks #1

merged 5 commits into from
Sep 15, 2021

Conversation

CMCDragonkai
Copy link
Member

Description

Adds benchmarks:

image

Issues Fixed

Final checklist

  • Domain specific tests
  • Full tests
  • Updated inline-comment documentation
  • Lint fixed
  • Squash and rebased
  • Sanity check the final build

@CMCDragonkai
Copy link
Member Author

The call overhead for a noop call to the workermanager is about 1.4 ms.

Which means on my system, no call to the worker manager will be faster than 1.4ms, that's the baseline.

For comparison, a noop call on main thread can do about 250 million ops per second.

Most things are not worth parallelising.

With JSON serialisation, base64, md5 hash, sha256 and sha512 hashes of a 1 MiB random byte buffer, it shows comparable operations worth parallelising.

At 1 KiB, it's still way faster to do the work on the Main CPU, in fact you have to multiply the ops per second by about 1000.

@CMCDragonkai
Copy link
Member Author

This PR has broken the docs building.

[nix-shell:~/Projects/js-workers]$ npm run docs

> @matrixai/workers@0.0.1 docs /home/cmcdragonkai/Projects/js-workers
> typedoc --out ./docs src && touch ./docs/.nojekyll

Error: node_modules/benny/lib/index.d.ts:1:23 - error TS2688: Cannot find type definition file for 'benchmark'.

1 /// <reference types="benchmark" />

Strange error.

@CMCDragonkai
Copy link
Member Author

The benchmark report should be combined with a report about the current CPU architecture too to make it comparable.

@CMCDragonkai
Copy link
Member Author

Docs is now fixed, it was using the old tsconfig.json, it is now pointing to tsconfig.build.json. This should be propagated back to TypeScript-Demo-Lib.

Ok ready to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant