[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4.2 New assorted suggestions (Part II)
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 26 Nov 2020 10:46:41 -0300
> 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
- References:
- Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Dibyendu Majumdar
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Dibyendu Majumdar
- Re: Lua 5.4.2 New assorted suggestions (Part II), Ranier Vilela
- Re: Lua 5.4.2 New assorted suggestions (Part II), Chris Smith
- Re: Lua 5.4.2 New assorted suggestions (Part II), Luiz Henrique de Figueiredo
- Re: Lua 5.4.2 New assorted suggestions (Part II), eugeny gladkih
- Re: Lua 5.4.2 New assorted suggestions (Part II), Roberto Ierusalimschy
- Re: Lua 5.4.2 New assorted suggestions (Part II), eugeny gladkih