On 10/12/2016 09:39 AM, Stefan Koch wrote:
On Wednesday, 12 October 2016 at 13:32:45 UTC, Stefan Koch wrote:
On Wednesday, 12 October 2016 at 12:46:50 UTC, Andrei Alexandrescu wrote:
In the second case, the compiler generates an inc for bumping the
pointer and a dec for decreasing the length (small instructions). If
the variable char_length is used, add/sub must be used (larger). --
When I write code so i can keep the
str = str[1 .. str.length]
It leads to lager code overall and decreases performance.
both in table lookup and in the multi-branch code.
for ldc the table-lookup code is faster 27% then the current popFront.
on dmd the table-lookup is 2% faster then the current popFront.
for ldc the branching code is 23% faster then the current popFront
for dmd the branching code is 20% faster then the current popFront
Thanks! I'd say make sure there is exactly 0% loss on performance
compared to the popFront in the ASCII case, and if so make a PR with the
table version. -- Andrei