From eaefe9a27254e7aa8d388ea3c1b902f03788b440 Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Wed, 13 Sep 2023 21:59:12 +0000 Subject: [PATCH] benchmark add utils --- benchmark/utils.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 benchmark/utils.js diff --git a/benchmark/utils.js b/benchmark/utils.js new file mode 100644 index 0000000..773cbba --- /dev/null +++ b/benchmark/utils.js @@ -0,0 +1,9 @@ +import { hexToBytes } from '../abstract/utils.js'; +import { run, mark } from 'micro-bmark'; + +run(async () => { + const hex32 = '0123456789abcdef'.repeat(4); + const hex256 = hex32.repeat(8); + await mark('hexToBytes 32b', 5000000, () => hexToBytes(hex32)); + await mark('hexToBytes 256b', 500000, () => hexToBytes(hex256)); +});