Skip to content

Commit

Permalink
Update the setup file to include a hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 16, 2025
1 parent d162035 commit edb9ffd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions setHasher.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
// Set the hasher to hashtree
// Used to run benchmarks with with visibility into hashtree performance, useful for Lodestar
import {beforeEach} from "@chainsafe/benchmark";
import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/cjs/hasher/index.js";
import {hasher} from "@chainsafe/persistent-merkle-tree/lib/cjs/hasher/hashtree.js";
setHasher(hasher);

beforeEach(() => {
console.log("-----------------------------------");
const memory = process.memoryUsage();
console.log(
`HT: ${(memory.heapTotal / 1024 / 1024).toFixed(2)}MB, HU: ${(
memory.heapUsed /
1024 /
1024
).toFixed(2)}MB, RSS: ${(memory.rss / 1024 / 1024).toFixed(2)}MB`
);
});

export {};

0 comments on commit edb9ffd

Please sign in to comment.