Changing front

This commit is contained in:
2023-01-16 17:44:37 +01:00
parent 0b8a93b256
commit 4fe4be7730
48586 changed files with 4725790 additions and 17464 deletions

View File

@@ -0,0 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const benny_1 = require("benny");
const index_1 = require("../index");
const wasm_1 = require("../wasm");
wasm_1.initWebAssembly().then(() => {
const randomInteger = (max = Number.MAX_SAFE_INTEGER) => Math.floor(Math.random() * max);
const options = { initCount: 100 };
benny_1.default.suite("Histogram percentile distribution", benny_1.default.add("Int32Histogram", () => {
const histogram = index_1.build({
bitBucketSize: 32
});
for (let index = 0; index < 1024; index++) {
histogram.recordValueWithCount(randomInteger(), randomInteger(100));
}
return () => {
histogram.outputPercentileDistribution();
};
}, options), benny_1.default.add("WASM 32B Histogram", () => {
const histogram = index_1.build({
bitBucketSize: 32,
useWebAssembly: true
});
for (let index = 0; index < 1024; index++) {
histogram.recordValueWithCount(randomInteger(), randomInteger(100));
}
return () => {
histogram.outputPercentileDistribution();
};
}, options), benny_1.default.add("Packed Histogram", () => {
const histogram = index_1.build({
bitBucketSize: "packed"
});
for (let index = 0; index < 1024; index++) {
histogram.recordValueWithCount(randomInteger(), randomInteger(100));
}
return () => {
histogram.outputPercentileDistribution();
};
}, options), benny_1.default.add("WASM Packed Histogram", () => {
const histogram = index_1.build({
bitBucketSize: "packed",
useWebAssembly: true
});
for (let index = 0; index < 1024; index++) {
histogram.recordValueWithCount(randomInteger(), randomInteger(100));
}
return () => {
histogram.outputPercentileDistribution();
};
}, options), benny_1.default.complete(), benny_1.default.save({ file: "distribution", format: "chart.html" }));
});
//# sourceMappingURL=histogram-distribution.js.map