Add a page of microbenchmarks for wasm-bindgen

This commit starts to add a page of microbenchmarks for wasm-bindgen
which we can hopefully track and compare over time. Right now it's
primarily focused on data collection, making it easy to collect data
across a number of benchmarks for comparison. It doesn't currently do
much in the way of actually comparing the results for you (aka drawing
pretty graphs), so let's left for a future step.

It's hoped though that we can use this to track performance improvements
as well as ensuring that they work over time!
This commit is contained in:
Alex Crichton
2019-04-29 13:32:01 -07:00
parent a7b85362ce
commit e4fd0fccb5
13 changed files with 897 additions and 7 deletions

14
benchmarks/utils.js Normal file
View File

@ -0,0 +1,14 @@
export class Lock {
constructor() {
this.lockHolder = null;
}
async withLock(scope) {
while (this.lockHolder !== null) {
await this.lockHolder;
}
this.lockHolder = Promise.resolve(null).then(scope);
await this.lockHolder;
this.lockHolder = null;
}
}