libmir / mir

Mir (backports): Sparse tensors, Hoffman
http://mir.libmir.org
Boost Software License 1.0
210 stars 20 forks source link

Added ndslice algorithm benchmarks #382

Closed ljubobratovicrelja closed 7 years ago

ljubobratovicrelja commented 7 years ago

Added benchmarks for referencing from blog post on mir.ndslice.algorithm. I have tried following style of existing benchmarks. Please let me know if you'd like it organized differently, or if there's anything we could improve in the code.

Iteration counts for benchmarks have been modified to stay in reasonable execution time frame.

Here are the results on my machine:

$ dub run --build=release-nobounds --compiler=ldmd2 --single binarization.d
Running ./binarization
                  lockstep = 169 ms, 871 μs, and 4 hnsecs
       assumeSameStructure = 39 ms, 105 μs, and 9 hnsecs
$ dub run --build=release-nobounds --compiler=ldmd2 --single convolution.d
Running ./convolution
                     loops = 4 secs, 857 ms, 601 μs, and 3 hnsecs
     mir.ndslice.algorithm = 153 ms, 100 μs, and 7 hnsecs

What worries me is if I remove mcpu=native flag, I get different results in the convolution benchmark:

Running ./convolution
                     loops = 1 sec, 649 ms, 99 μs, and 6 hnsecs
     mir.ndslice.algorithm = 159 ms, 392 μs, and 9 hnsecs

What exactly could be going on here?

codecov-io commented 7 years ago

Current coverage is 93.33% (diff: 100%)

Merging #382 into master will not change coverage

@@             master       #382   diff @@
==========================================
  Files            10         10          
  Lines          1350       1350          
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
  Hits           1260       1260          
  Misses           90         90          
  Partials          0          0          

Powered by Codecov. Last update c73f6c0...5202384