Skip to content

Commit d24d56b

Browse files
committed
Benchmark: update to binparse@2
1 parent 215959f commit d24d56b

File tree

3 files changed

+28
-24
lines changed

3 files changed

+28
-24
lines changed

benchmark/bench.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
const Benchmark = require("benchmark");
2-
const bp = require("binparse").bp;
3-
const Parser = require("../dist/binary_parser").Parser;
4-
const Destruct = require("destruct-js");
5-
const Struct = require("structron");
1+
import Benchmark from "benchmark";
2+
import { bp } from "binparse";
3+
import { Parser } from "../dist/binary_parser.js";
4+
import Destruct from "destruct-js";
5+
import Struct from "structron";
66

77
const suite = new Benchmark.Suite();
88

@@ -14,8 +14,8 @@ const PointParser = bp.object("Point", {
1414
});
1515

1616
const PointsParser = bp.object("SimpleObject", {
17-
length: bp.variable("len", bp.lu32),
18-
points: bp.array("Points", PointParser, "len"),
17+
length: bp.lu32,
18+
points: bp.array("Points", PointParser, "length"),
1919
});
2020

2121
// binary-parser

benchmark/package-lock.json

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmark/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"dependencies": {
33
"benchmark": "^2.1.4",
4-
"binparse": "1.2.1",
5-
"destruct-js": "^0.2.9",
4+
"binparse": "^2.1.0",
5+
"destruct-js": "^0.2.13",
66
"structron": "^0.4.3"
7-
}
7+
},
8+
"type": "module"
89
}

0 commit comments

Comments
 (0)