Looking for a Code Review of a Bioinformatics POC
H. S. Teoh
hsteoh at quickfur.ath.cx
Thu Jun 11 22:57:55 UTC 2020
On Thu, Jun 11, 2020 at 10:41:12PM +0000, duck_tape via Digitalmars-d-learn wrote:
> On Thursday, 11 June 2020 at 22:19:27 UTC, H. S. Teoh wrote:
> > To encourage inlining, you could make it an alias parameter instead
> > of a delegate, something like this:
> >
> > void overlap(alias cb)(SType start, SType stop) { ... }
> > ...
> > bed[chr].overlap!callback(st0, en0);
> >
>
>
> I don't think ldc can handl that yet. I get an error saying
>
> ```
> source/app.d(72,7): Error: function app.main.overlap!(callback).overlap
> requires a dual-context, which is not yet supported by LDC
> ```
>
> And I see an open ticket for it on the ldc project.
Oh right. :-( But in any case, I'm a little skeptical whether this is
the performance bottleneck anyway.
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.
T
--
Philosophy: how to make a career out of daydreaming.
More information about the Digitalmars-d-learn
mailing list