+++ /dev/null
-//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@codecow.com>
-//! SPDX-License-Identifier: GPL-3.0-or-later
-
-import './perf.wallet.mjs'
-import './perf.account.mjs'
-import './perf.block.mjs'
-
-console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold')
+++ /dev/null
-//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@codecow.com>
-//! SPDX-License-Identifier: GPL-3.0-or-later
-
-'use strict'
-
-import { Wallet } from 'libnemo'
-import { assert, stats, suite, test } from './GLOBALS.mjs'
-import { NANO_TEST_VECTORS } from './VECTORS.mjs'
-
-await Promise.all([
- suite('Account performance', { skip: true }, async () => {
- const COUNT = 0x200
-
- await test(`Time to create ${COUNT} BIP-44 accounts`, async () => {
- const wallet = await Wallet.create('BIP-44', NANO_TEST_VECTORS.PASSWORD)
- await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-
- const start = performance.now()
- const accounts = await wallet.accounts(0, COUNT - 1)
- const end = performance.now()
- console.log(`Total: ${end - start} ms`)
- console.log(`Average: ${(end - start) / COUNT} ms`)
- assert.equal(accounts.size, COUNT)
-
- await wallet.destroy()
- })
-
- await test(`Time to create ${COUNT} BLAKE2b accounts`, async () => {
- const wallet = await Wallet.create('BLAKE2b', NANO_TEST_VECTORS.PASSWORD)
- await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-
- const start = performance.now()
- const accounts = await wallet.accounts(0, COUNT - 1)
- const end = performance.now()
- console.log(`Total: ${end - start} ms`)
- console.log(`Average: ${(end - start) / COUNT} ms`)
- assert.equal(accounts.size, COUNT)
-
- await wallet.destroy()
- })
-
- await test(`Time to create 1 BIP-44 account ${COUNT} times`, async () => {
- const wallet = await Wallet.create('BIP-44', NANO_TEST_VECTORS.PASSWORD)
- await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-
- const times = []
- for (let i = 0; i < COUNT; i++) {
- const start = performance.now()
- await wallet.account(i)
- const end = performance.now()
- times.push(end - start)
- }
- console.log(stats(times))
-
- await wallet.destroy()
- })
-
- await test(`Time to create 1 BLAKE2b account ${COUNT} times`, async () => {
- const wallet = await Wallet.create('BLAKE2b', NANO_TEST_VECTORS.PASSWORD)
- await wallet.unlock(NANO_TEST_VECTORS.PASSWORD)
-
- const times = []
- for (let i = 0; i < COUNT; i++) {
- const start = performance.now()
- await wallet.account(i)
- const end = performance.now()
- times.push(end - start)
- }
- console.log(stats(times))
-
- await wallet.destroy()
- })
- })
-])
+++ /dev/null
-//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@codecow.com>
-//! SPDX-License-Identifier: GPL-3.0-or-later
-
-'use strict'
-
-import { Block } from 'libnemo'
-import { stats, suite, test } from './GLOBALS.mjs'
-import { NANO_TEST_VECTORS } from './VECTORS.mjs'
-
-await Promise.all([
- suite('Block performance', { skip: true }, async () => {
- const COUNT = 0x200
-
- await test(`sign a send block ${COUNT} times`, async () => {
- const { account, balance, key, previous, representative } = NANO_TEST_VECTORS.SEND_BLOCK
- const times = []
- const block = new Block(account, balance, previous, representative)
- .send(NANO_TEST_VECTORS.SEND_BLOCK.link, 0)
- for (let i = 0; i < COUNT; i++) {
- const start = performance.now()
- await block.sign(key)
- const end = performance.now()
- times.push(end - start)
- }
- console.log(stats(times))
- })
- })
-])
+++ /dev/null
-//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@codecow.com>
-//! SPDX-License-Identifier: GPL-3.0-or-later
-
-'use strict'
-
-import { Wallet } from 'libnemo'
-import { stats, suite, test } from './GLOBALS.mjs'
-import { NANO_TEST_VECTORS } from './VECTORS.mjs'
-
-await Promise.all([
- suite(`Wallet performance`, { skip: true }, async () => {
- const COUNT = 0x20
-
- await test(`Time to create ${COUNT} BIP-44 wallets`, async () => {
- const times = []
- for (let i = 0; i < COUNT; i++) {
- const start = performance.now()
- const wallet = await Wallet.create('BIP-44', NANO_TEST_VECTORS.PASSWORD)
- const end = performance.now()
- times.push(end - start)
- await wallet.destroy()
- }
- console.log(stats(times))
- })
-
- await test(`Time to create ${COUNT} BLAKE2b wallets`, async () => {
- const times = []
- for (let i = 0; i < COUNT; i++) {
- const start = performance.now()
- const wallet = await Wallet.create('BLAKE2b', NANO_TEST_VECTORS.PASSWORD)
- const end = performance.now()
- times.push(end - start)
- await wallet.destroy()
- }
- console.log(stats(times))
- })
- })
-])