authorgravatar for 124872+jedisct1@users.noreply.github.comFrank Denis <124872+jedisct1@users.noreply.github.com> 2021-02-28 12:53:27+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2021-02-28 21:55:24+02:00
logb959029f88fa033e54e72e42004bc261baada1f1
treefe88fbbbf198886f79eea6af0e0b6fe97a9d5ad5
parente65b6d99ac38686228bf5b5b9c1121382e05da4b

std/crypto/benchmark: update format strings

Use the s formatter to format strings.

1 files changed, 9 insertions(+), 9 deletions(-)

lib/std/crypto/benchmark.zig+9-9
...@@ -356,63 +356,63 @@ pub fn main() !void {...@@ -356,63 +356,63 @@ pub fn main() !void {
356 inline for (hashes) |H| {356 inline for (hashes) |H| {
357 if (filter == null or std.mem.indexOf(u8, H.name, filter.?) != null) {357 if (filter == null or std.mem.indexOf(u8, H.name, filter.?) != null) {
358 const throughput = try benchmarkHash(H.ty, mode(128 * MiB));358 const throughput = try benchmarkHash(H.ty, mode(128 * MiB));
359 try stdout.print("{:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });359 try stdout.print("{s:>17}: {:10} MiB/s\n", .{ H.name, throughput / (1 * MiB) });
360 }360 }
361 }361 }
362362
363 inline for (macs) |M| {363 inline for (macs) |M| {
364 if (filter == null or std.mem.indexOf(u8, M.name, filter.?) != null) {364 if (filter == null or std.mem.indexOf(u8, M.name, filter.?) != null) {
365 const throughput = try benchmarkMac(M.ty, mode(128 * MiB));365 const throughput = try benchmarkMac(M.ty, mode(128 * MiB));
366 try stdout.print("{:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });366 try stdout.print("{s:>17}: {:10} MiB/s\n", .{ M.name, throughput / (1 * MiB) });
367 }367 }
368 }368 }
369369
370 inline for (exchanges) |E| {370 inline for (exchanges) |E| {
371 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {371 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
372 const throughput = try benchmarkKeyExchange(E.ty, mode(1000));372 const throughput = try benchmarkKeyExchange(E.ty, mode(1000));
373 try stdout.print("{:>17}: {:10} exchanges/s\n", .{ E.name, throughput });373 try stdout.print("{s:>17}: {:10} exchanges/s\n", .{ E.name, throughput });
374 }374 }
375 }375 }
376376
377 inline for (signatures) |E| {377 inline for (signatures) |E| {
378 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {378 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
379 const throughput = try benchmarkSignature(E.ty, mode(1000));379 const throughput = try benchmarkSignature(E.ty, mode(1000));
380 try stdout.print("{:>17}: {:10} signatures/s\n", .{ E.name, throughput });380 try stdout.print("{s:>17}: {:10} signatures/s\n", .{ E.name, throughput });
381 }381 }
382 }382 }
383383
384 inline for (signature_verifications) |E| {384 inline for (signature_verifications) |E| {
385 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {385 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
386 const throughput = try benchmarkSignatureVerification(E.ty, mode(1000));386 const throughput = try benchmarkSignatureVerification(E.ty, mode(1000));
387 try stdout.print("{:>17}: {:10} verifications/s\n", .{ E.name, throughput });387 try stdout.print("{s:>17}: {:10} verifications/s\n", .{ E.name, throughput });
388 }388 }
389 }389 }
390390
391 inline for (batch_signature_verifications) |E| {391 inline for (batch_signature_verifications) |E| {
392 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {392 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
393 const throughput = try benchmarkBatchSignatureVerification(E.ty, mode(1000));393 const throughput = try benchmarkBatchSignatureVerification(E.ty, mode(1000));
394 try stdout.print("{:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });394 try stdout.print("{s:>17}: {:10} verifications/s (batch)\n", .{ E.name, throughput });
395 }395 }
396 }396 }
397397
398 inline for (aeads) |E| {398 inline for (aeads) |E| {
399 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {399 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
400 const throughput = try benchmarkAead(E.ty, mode(128 * MiB));400 const throughput = try benchmarkAead(E.ty, mode(128 * MiB));
401 try stdout.print("{:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });401 try stdout.print("{s:>17}: {:10} MiB/s\n", .{ E.name, throughput / (1 * MiB) });
402 }402 }
403 }403 }
404404
405 inline for (aes) |E| {405 inline for (aes) |E| {
406 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {406 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
407 const throughput = try benchmarkAes(E.ty, mode(100000000));407 const throughput = try benchmarkAes(E.ty, mode(100000000));
408 try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });408 try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
409 }409 }
410 }410 }
411411
412 inline for (aes8) |E| {412 inline for (aes8) |E| {
413 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {413 if (filter == null or std.mem.indexOf(u8, E.name, filter.?) != null) {
414 const throughput = try benchmarkAes8(E.ty, mode(10000000));414 const throughput = try benchmarkAes8(E.ty, mode(10000000));
415 try stdout.print("{:>17}: {:10} ops/s\n", .{ E.name, throughput });415 try stdout.print("{s:>17}: {:10} ops/s\n", .{ E.name, throughput });
416 }416 }
417 }417 }
418}418}