wip: crypto: use cppgc to manage Hash
While working on https://github.com/nodejs/node/issues/40786 I happened to notice that the current BaseObject management comes with a significant overhead from global handle creation and incidentally migrating these objects to Oilpan gives us faster creation of objects (in my local testing, creating a cppgc-managed object is about 2.5x faster than creating a weak BaseObject).
This is only a WIP and not yet ready for review. It's mostly open as a reference for https://github.com/nodejs/performance/issues/136 and for running benchmark CI. The primary blocker is that I'll need to figure out how to support embedder object book-keeping in the heap snapshot with cppgc (right now it doesn't work and embedder objects become missing in the heap snapshots) - EDIT: this is currently being worked on in https://chromium-review.googlesource.com/c/v8/v8/+/5630497
Refs: https://github.com/nodejs/performance/issues/136 Refs: https://github.com/nodejs/node/issues/40786
On macOS + M2 where OpenSSL 3 performs much better
confidence improvement accuracy (*) (**) (***)
crypto/create-hash.js n=100000 *** 16.29 % ±1.83% ±2.44% ±3.18%
confidence improvement accuracy (*) (**) (***)
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=10 sync='createHash' *** 9.52 % ±1.41% ±1.88% ±2.46%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=100 sync='createHash' *** 9.96 % ±1.71% ±2.27% ±2.97%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=20 sync='createHash' *** 9.85 % ±1.08% ±1.44% ±1.87%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=50 sync='createHash' *** 9.80 % ±1.91% ±2.55% ±3.35%
On Ubuntu + Intel(R) Xeon(R) Platinum 8280 CPU @ 2.70GHz, where OpenSSL 3 does not perform as well and becomes the bottleneck in digest computation:
confidence improvement accuracy (*) (**) (***)
crypto/create-hash.js n=100000 *** 17.17 % ±1.53% ±2.03% ±2.65%
confidence improvement accuracy (*) (**) (***)
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=10 sync='createHash' 0.43 % ±0.91% ±1.21% ±1.57%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=100 sync='createHash' 0.55 % ±0.98% ±1.31% ±1.70%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=20 sync='createHash' 0.18 % ±1.07% ±1.42% ±1.86%
crypto/webcrypto-digest.js n=100000 method='SHA-1' data=50 sync='createHash' 1.19 % ±1.71% ±2.28% ±2.98%