D easily overlooked?

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 2 08:41:54 PDT 2017


On Saturday, 2 September 2017 at 14:49:30 UTC, thinwybk wrote:
> On Friday, 14 July 2017 at 13:29:30 UTC, Joakim wrote:
>> Yes, D's compile-time regex are still the fastest in the world.
>>  I've been benching it recently for a marketing-oriented blog 
>> post I'm preparing for the official D blog, std.regex beats 
>> out the top C and Rust entries from the benchmarks game on 
>> linux/x64 with a single core:
>>
>> http://benchmarksgame.alioth.debian.org/u64q/regexredux.html
>> https://github.com/joakim-noah/regex-bench
>>
>> D comes in third on Android/ARM, but not far behind, 
>> suggesting it would still be third on that list if run with a 
>> bunch of other languages on mobile.  Dmitry thinks it might be 
>> alignment issues, the bane of cross-platform, high-performance 
>> code on ARM, as he hasn't optimized his regex code for ARM.
>
> Do you plan to implement a version for the fastest benchmark 
> "n-body" 
> (http://benchmarksgame.alioth.debian.org/u64q/nbody.html) as 
> well?

No, the goal is to demonstrate the nice, super-speedy regex 
engine in the D standard library by using that same benchmark 
that Dmitry exhibited years ago, to show D still does really well 
at regex.  It's not to try and compete across all those 
benchmarks, which D used to dominate at one time.

I did wonder how D does on that n-body benchmark now, so I built 
and ran the fastest C++ version, #8, on my single-core linux/x64 
VPS.  Here's the source link for each benchmark, the compiler 
version, and the command I used to build it:

C++:
http://benchmarksgame.alioth.debian.org/u64q/program.php?test=nbody&lang=gpp&id=8

clang/llvm 4.0.1

clang -O3 -std=c++11 nbody.cpp -lm -onbody-cpp

D:
https://bitbucket.org/qznc/d-shootout/raw/898f7f3b3c5d55680229113e973ef95ece6f711a/progs/nbody/nbody.d

ldc 1.4 beta1, llvm 4.0.1

ldc2 -O3 nbody.d

The D version averages 2.5 seconds, the C++ version 6 seconds, 
which means D would likely still be at the top of that n-body 
ranking today.

> Adding D to the performance comparison of 
> https://github.com/derekmolloy/exploringBB/tree/master/chp05/performance (companion code to the book "Exploring BeagleBone - Tools and Techniques For Building With Embedded Linux") could be good promotion in the embedded domain (where performance, Linux compatibility and code maintainability matters).

Hmm, I have not used an ARM board in years, my Pandaboard is in 
storage far away. By including Android/ARM in the regex blog 
post, hopefully some people will realize D is a good option there.


More information about the Digitalmars-d mailing list