Advertising

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). -- Andrei

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.
update:

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