For reference:
*) We need to get Leo's concerns about string reusability dealt with.
(Which, strictly speaking, wasn't discussed but it's been hanging too
long) We're generating too many new strings. Fooey.

Dan in "Change to the calling convention, and other fallout from last week's perl 6 meeting"

I have started with two:

  assign Sx, Sy
  substr_r Sx, Sy, Ix, Iy

Both reuse the destination string header (if one was there). Please have a look at the globber tests near the end of string.t for an example, when not to use these opcodes.

For many cases, when the destination is not referenced in another register, they can be safely used and speed up things drastically.

I changed life.pasm to use substr_r:
substr:   420 gens/s 10191 DOD runs/ 82 collect
substr_r: 695 gens/s    82 DOD runs/ 82 collect
(unoptimized build only for some relation of the 2)

Also Parrot_sprintf should heavily benfit from the new substr.

Have fun,
leo



Reply via email to