Looking for a Code Review of a Bioinformatics POC

tastyminerals tastyminerals at gmail.com
Thu Jun 11 20:14:17 UTC 2020


On Thursday, 11 June 2020 at 16:13:34 UTC, duck_tape wrote:
> Hi! I'm new to dlang but loving it so far! One of my favorite 
> first things to implement in a new language is an interval 
> library. In this case I want to submit to a benchmark repo: 
> https://github.com/lh3/biofast
>
> If anyone is willing to take a look and give some feedback I'd 
> be very appreciative! Specifically if you have an performance 
> improvement ideas: https://github.com/sstadick/dgranges/pull/1
>
> Currently my D version is a few seconds slower than the Crystal 
> version. putting it very solid in third place overall. I'm not 
> really sure where it's falling behind crystal since `-release` 
> removes bounds checking. I have not looked at the assembly 
> between the two, but I suspect that Crystal inlines the 
> callback and D does not.
>
> I also think there is room for improvement in the IO, as I'm 
> just using the defaults.


Move as much as possible code to compile time.
Do not allocate inside the loops.
Keep GC collection away from performance critical parts with 
GC.disable switch;

Also dflags-ldc "-mcpu=native" in dub.json might give you some 
edge.




More information about the Digitalmars-d-learn mailing list