lua-users home
lua-l archive

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


By the way, the timings in that last post demonstrate the importance of
malloc/free over marking: mark is almost free since there is only one live varargs tuple/table at any moment, but all of the blocks need to be malloc()'d and free()'d. Reducing the number of allocs per vararg from three to one should reduce the memory management cost by 2/3, and that is pretty well precisely what the benchmark demonstrated.

At the same time, it appears that the cost of varargs with the current implementation is roughly the base cost of a function call; if the function did anything complicated, the overhead would be a lot less noticeable. So reducing
the overhead by 2/3 is probably sufficient.

R.