howto count lines - fast

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 1 00:36:11 PDT 2017


On Wednesday, May 31, 2017 22:50:19 H. S. Teoh via Digitalmars-d-learn 
wrote:
> Perhaps the right approach is to check if the array length is less than
> some arbitrary threshold, and just use a naïve loop below that, and only
> switch to the complicated hackish stuff where you're sure it will
> actually benefit, rather than hurt, performance.

Based on some previous discussions, I think that this is the sort of thing
that std.algorithm.sort does (switch algorithms depending on the size of the
range to be sorted), but I've never actually verified it.

- Jonathan M Davis




More information about the Digitalmars-d-learn mailing list