As suggested by Brent, string_set gives us a big improvement, where strings are heavily used. One examples is life.pasm, where the generate loop does:

substr S0, S15, I3, 1

~10^6 times. Till now, S0 (the result of substr) was constructed every time, now it get's just reused.
This improves life generations from 400/370 to both 587 for GC/malloc allocators.

string_set is currently only used in string_substr, but, when people are ok with this, can be used everywhere in core.ops, where a string register is globbered.

set S0, S1 { $1 = $2 }

would become string_set(interpreter, $1, $2)

leo

Reply via email to