source: trip-planner-front/node_modules/hdr-histogram-js/dist/bench/histogram-data-access-co.js@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.8 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const benny_1 = require("benny");
4const index_1 = require("../index");
5const wasm_1 = require("../wasm");
6wasm_1.initWebAssembly().then(() => {
7 const randomInteger = () => Math.floor(Math.random() * 1000000);
8 const randomSmallInteger = () => Math.floor(Math.random() * 1000);
9 const options = { initCount: 1000 };
10 benny_1.default.suite("Histogram data access with coordinated ommissions", benny_1.default.add("Int32Histogram", () => {
11 const histogram = index_1.build({ bitBucketSize: 32 });
12 return () => {
13 histogram.recordValueWithExpectedInterval(randomInteger(), 100000);
14 };
15 }, options), benny_1.default.add("Int32Histogram no correction needed", () => {
16 const histogram = index_1.build({ bitBucketSize: 32 });
17 return () => {
18 histogram.recordValueWithExpectedInterval(randomSmallInteger(), 100000);
19 };
20 }, options), benny_1.default.add("PackedHistogram", () => {
21 const histogram = index_1.build({ bitBucketSize: "packed" });
22 return () => {
23 histogram.recordValueWithExpectedInterval(randomInteger(), 100000);
24 };
25 }, options), benny_1.default.add("PackedHistogram no correction needed", () => {
26 const histogram = index_1.build({ bitBucketSize: "packed" });
27 return () => {
28 histogram.recordValueWithExpectedInterval(randomSmallInteger(), 100000);
29 };
30 }, options), benny_1.default.add("WASM Int32Histogram", () => {
31 const histogram = index_1.build({
32 useWebAssembly: true
33 });
34 return () => {
35 histogram.recordValueWithExpectedInterval(randomInteger(), 100000);
36 };
37 }, options), benny_1.default.add("WASM Int32Histogram no correction needed", () => {
38 const histogram = index_1.build({
39 useWebAssembly: true
40 });
41 return () => {
42 histogram.recordValueWithExpectedInterval(randomSmallInteger(), 100000);
43 };
44 }, options), benny_1.default.add("WASM PackedHistogram", () => {
45 const histogram = index_1.build({
46 useWebAssembly: true,
47 bitBucketSize: "packed"
48 });
49 return () => {
50 histogram.recordValueWithExpectedInterval(randomInteger(), 100000);
51 };
52 }, options), benny_1.default.add("WASM PackedHistogram no correction needed", () => {
53 const histogram = index_1.build({
54 useWebAssembly: true,
55 bitBucketSize: "packed"
56 });
57 return () => {
58 histogram.recordValueWithExpectedInterval(randomSmallInteger(), 100000);
59 };
60 }, options), benny_1.default.complete(), benny_1.default.save({ file: "data-access-co", format: "chart.html" }));
61});
62//# sourceMappingURL=histogram-data-access-co.js.map
Note: See TracBrowser for help on using the repository browser.