(ctx context.Context)
| 36 | } |
| 37 | |
| 38 | func (c *commandBenchmarkCrypto) run(ctx context.Context) error { |
| 39 | results := c.runBenchmark(ctx) |
| 40 | |
| 41 | sort.Slice(results, func(i, j int) bool { |
| 42 | return results[i].throughput > results[j].throughput |
| 43 | }) |
| 44 | c.out.printStdout(" %-20v %-30v %v\n", "Hash", "Encryption", "Throughput") |
| 45 | c.out.printStdout("-----------------------------------------------------------------\n") |
| 46 | |
| 47 | for ndx, r := range results { |
| 48 | c.out.printStdout("%3d. %-20v %-30v %v / second", ndx, r.hash, r.encryption, units.BytesString(r.throughput)) |
| 49 | |
| 50 | if c.optionPrint { |
| 51 | c.out.printStdout(", --block-hash=%s --encryption=%s", r.hash, r.encryption) |
| 52 | } |
| 53 | |
| 54 | c.out.printStdout("\n") |
| 55 | } |
| 56 | |
| 57 | c.out.printStdout("-----------------------------------------------------------------\n") |
| 58 | c.out.printStdout("Fastest option for this machine is: --block-hash=%s --encryption=%s\n", results[0].hash, results[0].encryption) |
| 59 | |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | func (c *commandBenchmarkCrypto) runBenchmark(ctx context.Context) []cryptoBenchResult { |
| 64 | var results []cryptoBenchResult |
nothing calls this directly
no test coverage detected