niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

[jl] use `Float32` for `x` as C language #23

Closed Moelf closed 1 year ago

Moelf commented 1 year ago
julia> @benchmark f(rounds)
BenchmarkTools.Trial: 4396 samples with 1 evaluation.
 Range (min … max):  1.113 ms …  2.284 ms  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     1.126 ms              ┊ GC (median):    0.00%
 Time  (mean ± σ):   1.136 ms ± 38.187 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%

  ▆    █                                                      
  █▅▄▂▄█▄▇▃▄█▃▄▃▂▃▄▂▂▂▂▂▂▂▁▁▁▁▁▁▁▂▁▅▂▂▂▂▄▂▂▂▂▂▂▂▁▁▁▁█▂▃▂▂▂▂▂ ▂
  1.11 ms        Histogram: frequency by time        1.18 ms <

 Memory estimate: 0 bytes, allocs estimate: 0.

julia> @benchmark f(rounds)
BenchmarkTools.Trial: 6154 samples with 1 evaluation.
 Range (min … max):  775.301 μs … 994.998 μs  ┊ GC (min … max): 0.00% … 0.00%
 Time  (median):     788.927 μs               ┊ GC (median):    0.00%
 Time  (mean ± σ):   811.490 μs ±  53.952 μs  ┊ GC (mean ± σ):  0.00% ± 0.00%

    █▆█▆▅▂▂▂▂▂▁                                            ▄▄▂▂ ▁
  ▂▅████████████▇▆▇▆▆▆▇▅▆▇▅▅▆▆▄▅▅▆▆▇▅▄▆▆▅▅▅▆▄▅▆▄▄▅▅▄▄▅▅▅▆▅▅████ █
  775 μs        Histogram: log(frequency) by time        964 μs <

 Memory estimate: 0 bytes, allocs estimate: 0.
Moelf commented 1 year ago

I guess @workingjubilee is voting down because if https://github.com/niklas-heer/speed-comparison/pull/24

if #24 gets merged feel free to close this issue, basically, as long as we're using the same numerical types ...

niklas-heer commented 1 year ago

Okay, thank you @Moelf for contributing! I've merged #24, so I'll close this PR.