using BenchmarkHistograms
A = randn(10^5)
f(A) = min(A...)
g(A) = minimum(A)
g (generic function with 1 method)
@benchmark f($A)
samples: 877; evals/sample: 1; memory estimate: 5.34 MiB; allocs estimate: 200003 ns (4.48e6 - 5.08e6 ] ████████▉154 (5.08e6 - 5.69e6 ] ██████████████████████████████ 523 (5.69e6 - 6.29e6 ] ████68 (6.29e6 - 6.9e6 ] █▌24 (6.9e6 - 7.5e6 ] █▎20 (7.5e6 - 8.1e6 ] ██33 (8.1e6 - 8.71e6 ] █▌24 (8.71e6 - 9.31e6 ] █17 (9.31e6 - 9.92e6 ] ▋10 (9.92e6 - 1.052e7] ▏2 (1.052e7 - 1.113e7] ▏2 Counts min: 4.475 ms (0.00% GC); mean: 5.690 ms (6.20% GC); median: 5.306 ms (0.00% GC); max: 11.130 ms (0.00% GC).
@benchmark g($A)
samples: 10000; evals/sample: 1; memory estimate: 0 bytes; allocs estimate: 0 ns (48100.0 - 53500.0 ] ██████████████████████████████ 8101 (53500.0 - 58900.0 ] ███▏814 (58900.0 - 64300.0 ] ▎64 (64300.0 - 69700.0 ] █▍346 (69700.0 - 75100.0 ] █▎319 (75100.0 - 80500.0 ] ▏29 (80500.0 - 85900.0 ] ▌102 (85900.0 - 91200.0 ] ▋146 (91200.0 - 96600.0 ] ▏29 (96600.0 - 102000.0] ▏12 (102000.0 - 107400.0] ▏15 (107400.0 - 112800.0] ▏8 (112800.0 - 118200.0] ▏2 (118200.0 - 123600.0] ▏3 (123600.0 - 164600.0] ▏10 Counts min: 48.100 μs (0.00% GC); mean: 54.065 μs (0.00% GC); median: 51.700 μs (0.00% GC); max: 164.600 μs (0.00% GC).