Looking for a Code Review of a Bioinformatics POC

duck_tape sstadick at gmail.com
Thu Jun 11 23:02:21 UTC 2020


On Thursday, 11 June 2020 at 22:57:55 UTC, H. S. Teoh wrote:

> But one simple thing to try is to add 'scope' to the callback 
> parameter, which could potentially save you a GC allocation. 
> I'm not 100% certain this will make a difference, but since 
> it's such an easy change it's worth a shot.

I will give that a shot! Also of interest, the profiler results 
on a full runthrough do show file writing and int parsing as the 
2nd and 3rd most time consuming activities:

```
   Num          Tree        Func        Per
   Calls        Time        Time        Call

8942869       46473       44660           0     void 
app.IITree!(int, bool).IITree.overlap(int, int, void 
delegate(app.IITree!(int, bool).IITree.Interval))
8942869       33065        9656           0     @safe void 
std.stdio.File.write!(char[], immutable(char)[], char[], 
immutable(char)[], char[], immutable(char)[], int, 
immutable(char)[], int, char).write(char[], immutable(char)[], 
char[], immutable(char)[], char[], immutable(char)[], int, 
immutable(char)[], int, char)
20273052       10024        9569           0     pure @safe int 
std.conv.parse!(int, char[]).parse(ref char[])
       1      128571        8894        8894     _Dmain
80485821        6539        6539           0     nothrow @nogc 
@trusted ulong 
std.stdio.trustedFwrite!(char).trustedFwrite(shared(core.stdc.stdio.__sFILE)*, const(char[]))
17885738        8606        3808           0     @safe void 
std.conv.toTextRange!(int, 
std.stdio.File.LockingTextWriter).toTextRange(int, 
std.stdio.File.LockingTextWriter)
30409578        3751        3751           0     pure nothrow 
@nogc @trusted char[] std.algorithm.searching.find!("a == b", 
char[], char).find(char[], char).trustedMemchr(ref char[], ref 
char)
10136528        3300        3274           0     ulong 
std.stdio.File.readln!(char).readln(ref char[], dchar)
30409578       13151        3047           0     pure @safe 
char[] app.next!(std.algorithm.iteration.splitter!("a == b", 
char[], char).splitter(char[], char).Result).next(ref 
std.algorithm.iteration.splitter!("a == b", char[], 
char).splitter(char[], char).Result)
30409578        8964        2605           0     pure @property 
@safe char[] std.algorithm.iteration.splitter!("a == b", char[], 
char).splitter(char[], char).Result.front()
30409578        6289        2471           0     pure @safe 
char[] std.algorithm.searching.find!("a == b", char[], 
char).find(char[], char)
```



More information about the Digitalmars-d-learn mailing list