]> git.codecow.com Git - libnemo.git/commitdiff
PoW performance depends on nano-pow, so swap it for signature performance metrics.
authorChris Duncan <chris@zoso.dev>
Wed, 13 Aug 2025 20:35:43 +0000 (13:35 -0700)
committerChris Duncan <chris@zoso.dev>
Wed, 13 Aug 2025 20:35:43 +0000 (13:35 -0700)
test/perf.block.mjs

index 650911006e68a8e1ff6b44c609ec1a0501219fda..4bfcd8946a07c749dd78003dc3fe130582ab1806 100644 (file)
@@ -20,17 +20,16 @@ await Promise.all([
        suite('Block performance', { skip: true }, async () => {
                const COUNT = 0x200
 
-               await test(`libnemo: Time to calculate proof-of-work for a send block ${COUNT} times`, { skip: true }, async () => {
-                       const { account, balance, previous, representative } = NANO_TEST_VECTORS.SEND_BLOCK
+               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, representative, previous)
+                       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.pow()
+                               await block.sign(key)
                                const end = performance.now()
                                times.push(end - start)
-                               console.log(`${block.work} (${end - start} ms)`)
                        }
                        console.log(stats(times))
                })