On Wednesday, 12 October 2016 at 10:15:17 UTC, Matthias Bentrup
wrote:
On Wednesday, 12 October 2016 at 09:23:53 UTC, Stefan Koch
wrote:
On Wednesday, 12 October 2016 at 08:56:59 UTC, Matthias
Bentrup wrote:
[...]
All three are slower than baseline, for my test-case.
What did you test it against.
The blns.txt file mentioned upthread.
And what were your timings ?
BTW. the code you posted would not be a proper replacement for
utf8 popFront since our UTF8-popFront does handle depreacted
sequences correctly.
making it equivalent to this code :
void pfnew(ref char[] s) @trusted pure nothrow
{
immutable c = s[0];
uint char_length = 1;
if (c < 192)
{
Lend :
s = s.ptr[char_length .. s.length];
} else {
if (c < 192+32)
{
char_length = 2;
}
else if (c < 192+32+16)
{
char_length = 3;
}
else if (c < 192+32+16+8)
{
char_length = 4;
}
else if (c < 192+32+16+8+4)
{
char_length = 5;
}
else if (c < 192+32+16+8+4+2)
{
char_length = 6;
}
char_length = char_length > s.length ? s.length :
char_length;
goto Lend;
}
}