lua-users home
lua-l archive

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


> yep, it’s first thing being better. the 2nd one - usually I know the
> string length and can’t see any reason to compute it once again.

Let us try to say again: unlike lua_pushlstring, lua_pushstring uses
a cache. If the string is in the cache---and frequently it is---
lua_pushstring DOESN'T COMPUTE THE STRING LENGTH at all, and it
is way faster than lua_pushlstring.

If you care to measure you will see the difference.

-- Roberto