From 9d03435781321ec0ffd858f6c6ecf670a77fa23d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mamy=20Andr=C3=A9-Ratsimbazafy?= Date: Fri, 13 Dec 2019 11:51:18 +0100 Subject: [PATCH] Report when we skip BLS and state root verification --- nbench/bench_lab.nim | 1 + nbench/nbench.nim | 5 ++++- nbench/reports.nim | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/nbench/bench_lab.nim b/nbench/bench_lab.nim index 231464f9e7..7a457e43a9 100644 --- a/nbench/bench_lab.nim +++ b/nbench/bench_lab.nim @@ -86,6 +86,7 @@ template fnExit(name: string, id: int, startTime, startCycle: untyped): untyped discard BenchMetrics[id].cumulatedCycles.atomicInc(elapsedCycles) when nbench_trace: + # Advice: Use "when name == relevantProc" to isolate specific procedures. # strformat doesn't work in templates. echo static(alignLeft(name, 50)), "Time (ms): ", alignLeft(formatFloat(elapsedTime.float64 * 1e-6, precision=3), 10), diff --git a/nbench/nbench.nim b/nbench/nbench.nim index 15705a89e7..1b561a8758 100644 --- a/nbench/nbench.nim +++ b/nbench/nbench.nim @@ -112,7 +112,10 @@ proc main() = else: quit "Unsupported" - reportCli(BenchMetrics, const_preset) + # TODO: Nimbus not fine-grained enough in UpdateFlags + let flags = if scenario.skipBLS: "[skipBLS, skipStateRootVerification]" + else: "[withBLS, withStateRootVerification]" + reportCli(BenchMetrics, const_preset, flags) when isMainModule: main() diff --git a/nbench/reports.nim b/nbench/reports.nim index 32d4f46c4d..aa4000455e 100644 --- a/nbench/reports.nim +++ b/nbench/reports.nim @@ -21,7 +21,7 @@ cpuX86: # Reporting benchmark result # ------------------------------------------------------- -proc reportCli*(metrics: seq[Metadata], preset: string) = +proc reportCli*(metrics: seq[Metadata], preset, flags: string) = cpuX86: let name = cpuName() @@ -35,7 +35,7 @@ proc reportCli*(metrics: seq[Metadata], preset: string) = echo "\n" echo lineSep echo &"""|{"Procedures (" & preset & ')':^50}|{"# of Calls":^14}|{"Time (ms)":^15}|{"Avg Time (ms)":^17}|{"CPU cycles (in billions)":^26}|{"Avg cycles (in billions)":^26}|""" - echo &"""|{' '.repeat(50)}|{' '.repeat(14)}|{' '.repeat(15)}|{' '.repeat(17)}|{"indicative only":^26}|{"indicative only":^26}|""" + echo &"""|{flags:^50}|{' '.repeat(14)}|{' '.repeat(15)}|{' '.repeat(17)}|{"indicative only":^26}|{"indicative only":^26}|""" echo lineSep for m in metrics: if m.numCalls == 0: