Parrot_reallocate_string was missing one important feature - it did never reallocate the string. It always allocated a new string and copied data.

Execution of the test program below goes from 14s to 0.09 s (unoptimized build, Athlon 800).

leo

_main:
    set S0, ""
    set I0, 100000
    time N0
lp:
    concat S0, "1234567890"
    dec I0
    if I0, lp
    time N1
    sub N1, N0
    print "Len "
    length I1, S0
    print I1
    print " time "
    print N1
    print "\n"
    end



Reply via email to