mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
std/crypto/benchmark: update format strings
Use the s formatter to format strings.
This commit is contained in:
parent
e65b6d99ac
commit
b959029f88
@ -356,63 +356,63 @@ pub fn main() !void {
|
||||
inline for (hashes) |H| {
|
||||
if (filter == null or std.mem.indexOf(u8, H.name, filter.?) != null) {
|
||||
const throughput = try benchmarkHash(H.ty, mode(128 * MiB));
|
||||
try stdout.print("{:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });
|
||||
try stdout.print("{s:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (macs) |M| {
|
||||
if (filter == null or std.mem.indexOf(u8, M.name, filter.?) != null) {
|
||||
const throughput = try benchmarkMac(M.ty, mode(128 * MiB));
|
||||
try stdout.print("{:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });
|
||||
try stdout.print("{s:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (exchanges) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkKeyExchange(E.ty, mode(1000));
|
||||
try stdout.print("{:>17}: {:10} exchanges/s\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} exchanges/s\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (signatures) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkSignature(E.ty, mode(1000));
|
||||
try stdout.print("{:>17}: {:10} signatures/s\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} signatures/s\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (signature_verifications) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkSignatureVerification(E.ty, mode(1000));
|
||||
try stdout.print("{:>17}: {:10} verifications/s\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} verifications/s\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (batch_signature_verifications) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkBatchSignatureVerification(E.ty, mode(1000));
|
||||
try stdout.print("{:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (aeads) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkAead(E.ty, mode(128 * MiB));
|
||||
try stdout.print("{:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });
|
||||
try stdout.print("{s:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (aes) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkAes(E.ty, mode(100000000));
|
||||
try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
|
||||
inline for (aes8) |E| {
|
||||
if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
|
||||
const throughput = try benchmarkAes8(E.ty, mode(10000000));
|
||||
try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });
|
||||
try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user