lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

Sean Conner wrote:
>  97.71    314.31   314.31  2888775     0.00     0.00  luaS_newlstr
>   9.39      2.15     0.55  2888775     0.00     0.00  luaS_newlstr

Umm, can you get a line-by-line profile? If not, then maybe
compile lstring.c with -O2 -fno-inline and see what pops up.

One explanation for this difference would be excessive string hash
collisions. But I don't know how that could be triggered by the
interactive mode (well, it creates a few strings).

You may want to measure the length of the chain in luaS_newlstr
and print a message if it exceeds (say) 50. The chain length
should be somwhere between 1 and 3 on average.

You could also trace the calls to luaS_resize. The string table
usually grows and only occasionally shrinks. But there shouldn't
be continuous resizing.