Skip to content

Commit

Permalink
Report when we skip BLS and state root verification
Browse files Browse the repository at this point in the history
  • Loading branch information
mratsim committed Dec 18, 2019
1 parent d0e0a91 commit 9d03435
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions nbench/bench_lab.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
5 changes: 4 additions & 1 deletion nbench/nbench.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions nbench/reports.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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:
Expand Down

0 comments on commit 9d03435

Please sign in to comment.