Benchmarking mir.ndslice + lubeck against numpy and Julia

Jon Degenhardt jond at
Sat Jan 11 23:20:22 UTC 2020

On Saturday, 11 January 2020 at 22:50:46 UTC, p.shkadzko wrote:
> On Saturday, 11 January 2020 at 22:21:18 UTC, user1234 wrote:
>> On Saturday, 11 January 2020 at 21:54:13 UTC, p.shkadzko wrote:
>>> Today I decided to write a couple of benchmarks to compare D 
>>> mir with lubeck against Python numpy, then I also added Julia 
>>> snippets. The results appeared to be quite interesting.
>>> [...]
>> Can you specify the command line used for D ?
>> For now it's not clear if use LDC, GDC or DMD and the options 
>> used (assertions compiled or not ?). DMD is not a good choice 
>> for benchmarking.
> All D code was compiled with ldc2
> dub build --compiler=ldc2 --single matrix_ops.d
> I also tried using $DFLAGS="--O3" but that didn't produce 
> better results.

A useful set of flags to try:

     -O -release -flto=thin 

The '-flto' option turns on LTO. Doesn't always help, but 
sometimes makes a significant difference, especially when library 
code is used in tight loops. Another option is to disable bounds 
checking in @safe code (--boundscheck=off).

More information about the Digitalmars-d mailing list