-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the setup file to include a hook
- Loading branch information
1 parent
d162035
commit edb9ffd
Showing
1 changed file
with
13 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 {}; |