Skip to content

Optimize unpackCString# to use one word less per Char

Andreas Klebinger requested to merge wip/unpackString into master

unpackCString# is a recursive function which for each iteration returns a Cons cell containing the current Char, and a thunk for unpacking the rest of the string.

In this patch we change from storing addr + offset inside this thunk to storing only the addr, simply incrementing the address on each iteration.

This saves one word per unpacked character.

I also removed the now redundant local unpack definitions, This removes one call per unpack operation.

Merge request reports