]> zoso.dev Git - nano-pow.git/commitdiff
Tweak test summary output.
authorChris Duncan <chris@zoso.dev>
Fri, 17 Jan 2025 20:00:02 +0000 (12:00 -0800)
committerChris Duncan <chris@zoso.dev>
Fri, 17 Jan 2025 20:00:02 +0000 (12:00 -0800)
src/classes/gpu.ts
test.html

index bc7348aa8545cb391fa766370073d449c21924b4..32f251bb00b3354e34b15533f417d37cb532dbe1 100644 (file)
@@ -242,7 +242,6 @@ export class NanoPowGpu {
                        times.push(performance.now() - start)
                } while (this.#busy)
                if (debug) {
-                       console.log(`%cNanoPow (WebGPU) | Dispatch: ${effort ** 2} | Threads: ${8 * 8 * (effort ** 2)}`)
                        this.#logAverages(times)
                }
                return nonce.toString(16).padStart(16, '0')
index 0e2857688b102d5ddbee8af642db1c8a7a361e07..a869d42854fd585ac55eeb682442024e32764487 100644 (file)
--- a/test.html
+++ b/test.html
@@ -28,7 +28,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                        return hex
                }
 
-               function average (times) {
+               function average (times, effort) {
                        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++) {
@@ -39,16 +39,19 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                max = Math.max(max, times[i])
                                if (count < 3 || (i > (count * 0.1) && i < (count * 0.9))) truncated += times[i]
                        }
+                       const title = `NanoPow (WebGPU) | Dispatch: ${(0x100 * effort) ** 2} | Threads: ${8 * 8 * (0x100 * effort) ** 2}`
                        return {
-                               count: count,
-                               total: sum,
-                               rate: 1000 * count / (truncated || sum),
-                               min: min,
-                               max: max,
-                               arithmetic: sum / count,
-                               truncated: truncated / count,
-                               harmonic: count / reciprocals,
-                               geometric: Math.exp(logarithms / count)
+                               [title]: {
+                                       count: count,
+                                       total: sum,
+                                       rate: 1000 * count / (truncated || sum),
+                                       min: min,
+                                       max: max,
+                                       arithmetic: sum / count,
+                                       truncated: truncated / count,
+                                       harmonic: count / reciprocals,
+                                       geometric: Math.exp(logarithms / count)
+                               }
                        }
                }
 
@@ -108,7 +111,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
                                if (isOutputShown) document.getElementById('output').innerHTML += `${msg}<br/>`
                        }
                        document.getElementById('output').innerHTML += `<hr/>`
-                       document.getElementById('summary').innerHTML += `${JSON.stringify(average(times), null, '\t')}<br/>`
+                       document.getElementById('summary').innerHTML += `${JSON.stringify(average(times, effort), null, '\t')}<br/>`
                        print(times)
                        document.getElementById('status').innerHTML = `TESTING COMPLETE<br/>`
                        console.log('%cTESTING COMPLETE', 'color:orange;font-weight:bold')