lua-cmsgpack icon indicating copy to clipboard operation
lua-cmsgpack copied to clipboard

unpack performance optimization: preallocate the table when unpack map

Open guanlan opened this issue 11 years ago • 0 comments

lua_newtable function is equivalent to lua_createtable(L, 0, 0). The rehashing will cost too much time. The benchmark show the preallocate is faster ~30% than original version on random data.

guanlan avatar Jul 09 '13 00:07 guanlan