Skip to content

Commit

Permalink
bench
Browse files Browse the repository at this point in the history
  • Loading branch information
hazae41 committed Oct 4, 2023
1 parent 20a3081 commit a8d7d71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mods/ens/index.bench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ function namehash(name: string) {

const selfResult = benchSync("cubane", () => {
tryNamehash("hello.world.eth")
}, { samples: 100000, warmup: true })
}, { samples: 10000, warmup: true })

const viemResult = benchSync("viem", () => {
viem.namehash("hello.world.eth")
}, { samples: 100000, warmup: true })
}, { samples: 10000, warmup: true })

const ensResult = benchSync("ens", () => {
ens.hash("hello.world.eth")
}, { samples: 100000, warmup: true })
}, { samples: 10000, warmup: true })

selfResult.tableAndSummary(viemResult, ensResult)
1 change: 1 addition & 0 deletions src/mods/ens/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ test("ens", async () => {
assert(namehash("eth") === "0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae")
assert(namehash("alice.eth") === "0x787192fc5378cc32aa956ddfdedbf26b24e8d78e40109add0eea2c1a012c3dec")
assert(namehash("its.a.test.lol.eth") === "0x61d39393e17dec1ceab75d6a06e6e715b8271cd0e93e0949e12db1e92f077189")
assert(namehash("hello.world.eth") === "0xb6561cd3dc373d2bc592e2444182153bc8d4b9059e7b3b6e8d2b6d743a8b6b39")
})

0 comments on commit a8d7d71

Please sign in to comment.