|
1 | | -benchmark_workload_smol() = @benchmark workload_smol(1_000) |
2 | | -benchmark_workload_32_224_224_uint8() = @benchmark workload_32_224_224_uint8(100) |
3 | | -benchmark_workload_streaming_request() = @benchmark workload_streaming_request(1_000) |
4 | | -benchmark_workload_streaming_response() = @benchmark workload_streaming_response(1_000) |
5 | | -benchmark_workload_streaming_bidirectional() = |
6 | | - @benchmark workload_streaming_bidirectional(1_000) |
| 1 | +benchmark_workload_smol() = @benchmark workload_smol() |
| 2 | +benchmark_workload_32_224_224_uint8() = @benchmark workload_32_224_224_uint8() |
| 3 | +benchmark_workload_streaming_request() = @benchmark workload_streaming_request() |
| 4 | +benchmark_workload_streaming_response() = @benchmark workload_streaming_response() |
| 5 | +benchmark_workload_streaming_bidirectional() = @benchmark workload_streaming_bidirectional() |
7 | 6 |
|
8 | 7 |
|
9 | | -function perform_benchmark(f, N) |
| 8 | +function perform_benchmark(f) |
| 9 | + # Hack to make the code cleaner (benchmarks return number of messages per workload) |
| 10 | + N = f() |
| 11 | + |
10 | 12 | b = @benchmark $f($N) |
11 | 13 | timing = sum(b.times) / 1e9 |
12 | 14 | timings_us = b.times ./ 1e3 |
@@ -42,14 +44,14 @@ function benchmark_table() |
42 | 44 | ["", "KiB/message", "allocs/message", "messages/s", "μs", "μs", "μs", "μs"], |
43 | 45 | ] |
44 | 46 | all_benchmarks = [ |
45 | | - (workload_smol, 1_000), |
46 | | - (workload_32_224_224_uint8, 100), |
47 | | - (workload_streaming_request, 1_000), |
48 | | - (workload_streaming_response, 1_000), |
49 | | - (workload_streaming_bidirectional, 1_000), |
| 47 | + workload_smol, |
| 48 | + workload_32_224_224_uint8, |
| 49 | + workload_streaming_request, |
| 50 | + workload_streaming_response, |
| 51 | + workload_streaming_bidirectional, |
50 | 52 | ] |
51 | 53 |
|
52 | | - all_results = [perform_benchmark(f, N) for (f, N) in ProgressBar(all_benchmarks)] |
| 54 | + all_results = [perform_benchmark(f) for f in ProgressBar(all_benchmarks)] |
53 | 55 |
|
54 | 56 | pretty_table( |
55 | 57 | permutedims(reduce(hcat, all_results)); |
|
0 commit comments