Skip to content

Commit

Permalink
fix: hasher executeHashComputations() benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
twoeths committed Jun 12, 2024
1 parent 00f8a99 commit 0dfad11
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/persistent-merkle-tree/test/perf/hasher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ import {buildComparisonTrees} from "../utils/tree";
describe("hasher", function () {
this.timeout(0);

// total number of time running hash for 250_000 validators
// const iterations = 2_250_026;
const iterations = 1_000_000;
const iterations = 500_000;

const root1 = new Uint8Array(32);
const root2 = new Uint8Array(32);
Expand All @@ -21,8 +19,6 @@ describe("hasher", function () {
root2[i] = 2;
}

const [tree] = buildComparisonTrees(16);

const hashObjects: HashObject[] = [];
for (let i = 0; i < iterations; i++) {
hashObjects.push(uint8ArrayToHashObject(root1));
Expand Down Expand Up @@ -56,7 +52,11 @@ describe("hasher", function () {

itBench({
id: `executeHashComputations - ${hasher.name}`,
fn: () => {
beforeEach: () => {
const [tree] = buildComparisonTrees(16);
return tree;
},
fn: (tree) => {
hasher.executeHashComputations(tree.hashComputations);
},
});
Expand Down

0 comments on commit 0dfad11

Please sign in to comment.