Can you shrink it further?

Stefan Koch via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 11 01:51:54 PDT 2016


On Tuesday, 11 October 2016 at 08:17:52 UTC, Stefan Koch wrote:
>
> Also the code produces conditional set instructions which have 
> a higher latency.
> And worse throughput.

On my arguably a bit dated laptop:
popFront3 performs 109 us best time
and popFront4 performs with 265 us best time

Testcode :
void main()
{
import std.datetime : StopWatch;
import std.stdio;
foreach(_;0 .. 255) {
char[] test1 = (import("blns.txt")).dup;
StopWatch sw;
sw.start;
while(test1.length) popFront(test1);
sw.stop;
writeln("pf1 took ", sw.peek.usecs, "us");
sw.reset();
}
}

blns.txt is taken from
https://github.com/minimaxir/big-list-of-naughty-strings/blob/master/blns.txt



More information about the Digitalmars-d mailing list