forked from rescript-lang/rescript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbs_rbset_int_bench.js
61 lines (52 loc) · 1.29 KB
/
bs_rbset_int_bench.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// Generated by ReScript, PLEASE EDIT WITH CARE
'use strict';
var Rbset = require("./rbset.js");
function bench(param) {
var data = "Empty";
console.time("bs_rbset_int_bench.res 6");
for(var i = 0; i <= 1000000; ++i){
data = Rbset.add(i, data);
}
console.timeEnd("bs_rbset_int_bench.res 6");
console.time("bs_rbset_int_bench.res 11");
for(var i$1 = 0; i$1 <= 1000000; ++i$1){
if (!Rbset.mem(i$1, data)) {
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"bs_rbset_int_bench.res",
13,
6
],
Error: new Error()
};
}
}
console.timeEnd("bs_rbset_int_bench.res 11");
console.time("bs_rbset_int_bench.res 16");
for(var i$2 = 0; i$2 <= 1000000; ++i$2){
data = Rbset.remove(i$2, data);
}
console.timeEnd("bs_rbset_int_bench.res 16");
if (Rbset.cardinal(data) === 0) {
return;
}
throw {
RE_EXN_ID: "Assert_failure",
_1: [
"bs_rbset_int_bench.res",
21,
2
],
Error: new Error()
};
}
console.time("bs_rbset_int_bench.res 24");
bench();
console.timeEnd("bs_rbset_int_bench.res 24");
var count = 1000000;
var V;
exports.count = count;
exports.V = V;
exports.bench = bench;
/* Not a pure module */