import { Bip44Wallet, Blake2bWallet } from '#dist/main.js'
await suite('Account performance', async () => {
- await test('Time to create 0x2000 BIP-44 accounts', async () => {
+ await test('Time to create 0x200 BIP-44 accounts', async () => {
const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)
await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
const start = performance.now()
assert.equals(accounts.length, 0x2000)
})
+ await test('Time to create 0x200 BLAKE2b accounts', async () => {
+ const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)
+ await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
+ const start = performance.now()
+ const accounts = await wallet.accounts(0, 0x1fff)
+ const end = performance.now()
+ console.log(`Total: ${end - start} ms`)
+ console.log(`Average: ${(end - start) / 0x2000} ms`)
+ assert.equals(accounts.length, 0x2000)
+ })
+
await test('Time to create 1 BIP-44 account 0x20 times', async () => {
const times = []
const wallet = await Bip44Wallet.create(NANO_TEST_VECTORS.PASSWORD)
console.log(`Geometric: ${geometric} ms`)
})
- await test('Time to create 0x2000 BLAKE2b accounts', async () => {
- const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)
- await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
- const start = performance.now()
- const accounts = await wallet.accounts(0, 0x1fff)
- const end = performance.now()
- console.log(`Total: ${end - start} ms`)
- console.log(`Average: ${(end - start) / 0x2000} ms`)
- assert.equals(accounts.length, 0x2000)
- })
-
await test('Average time to create 1 BLAKE2b account 0x20 times', async () => {
const times = []
const wallet = await Blake2bWallet.create(NANO_TEST_VECTORS.PASSWORD)