From e33c01739926db5508abd20b5449407e0d5aef4d Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 14 Jan 2025 08:47:55 -0800 Subject: [PATCH] Add calculation rate to benchmarks. --- benchmarks.md | 25 +++++++++++++++++++++++++ test.html | 6 ++++-- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/benchmarks.md b/benchmarks.md index 1055b5d..1e5deec 100644 --- a/benchmarks.md +++ b/benchmarks.md @@ -200,6 +200,31 @@ NanoPow (WebGPU) 0x400 "geometric": 166.5867151432514 } +NanoPow (WebGPU) 3070 (0x400) +{ + "count": 512, + "total": 138190.59999987483, + "min": 9.799999997019768, + "max": 1512.5999999940395, + "arithmetic": 269.9035156247555, + "truncated": 201.92070312495343, + "harmonic": 90.32084803883801, + "geometric": 166.60778722043577 +} + +NanoPow (WebGPU) 3070 (0x400) +{ + "count": 512, + "total": 139817.9999998659, + "rate": 3.6619033314772853, + "min": 11.599999994039536, + "max": 1748.4000000059605, + "arithmetic": 273.08203124973807, + "truncated": 202.18183593745925, + "harmonic": 92.89356260079113, + "geometric": 168.54025739379932 +} + NanoPowGpu: Time to calculate proof-of-work for a send block 32 times diff --git a/test.html b/test.html index b5d0d88..9310bea 100644 --- a/test.html +++ b/test.html @@ -29,7 +29,7 @@ SPDX-License-Identifier: GPL-3.0-or-later } function average (times) { - let count = times.length, sum = 0, reciprocals = 0, logarithms = 0, truncated = 0, min = 0xffff, max = 0 + let count = times.length, sum = 0, reciprocals = 0, logarithms = 0, truncated = 0, min = 0xffff, max = 0, rate = 0 times.sort() for (let i = 0; i < count; i++) { sum += times[i] @@ -42,6 +42,7 @@ SPDX-License-Identifier: GPL-3.0-or-later return { count: count, total: sum, + rate: count / sum * 1000, min: min, max: max, arithmetic: sum / count, @@ -53,8 +54,9 @@ SPDX-License-Identifier: GPL-3.0-or-later function print (times) { const { arithmetic, count, geometric, harmonic, min, max, total, truncated } = average(times) - console.log(`Count: ${count} ms`) + console.log(`Count: ${count} nonces`) console.log(`Total: ${total} ms`) + console.log(`Rate: ${count} nonces/second`) console.log(`Minimum: ${min} ms`) console.log(`Maximum: ${max} ms`) console.log(`Arithmetic Mean: ${arithmetic} ms`) -- 2.34.1