lua-users home
lua-l archive

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


On Wed, Mar 21, 2012 at 4:44 PM, Roberto Ierusalimschy
<roberto@inf.puc-rio.br> wrote:
> However, what we are most
> interested is about the performance of this new version against 5.2.0 in
> real programs (in respect to string manipulation).

I didn't measure a difference on basic tests of parsing some Lua code
with Metalua or LuaInspect.  The following does show some difference
though:

$ wget https://raw.github.com/davidm/lua-balanced/b5a512915efe822985b712bc5b0a4959f0cccd0e/luabalanced.lua
$ echo 'local LB = require "luabalanced"; local text =
io.open"all.lua":read"*a"; for i=1,3 do LB.gsub(text, function(c,s)
end) end' > test.lua
$ wget http://luarocks.org/releases/luarocks-2.0.8.tar.gz
$ tar xzvf luarocks-2.0.8.tar.gz
$ cat `find luarocks-2.0.8/ -name '*.lua'` > all.lua
$ for x in 5.1.4 5.2.0 5.2.1-work1; do time lua-$x/src/lua  test.lua; done

times (on x86 Xeon):
5.1.4:          1.8 1.8 1.8 s
5.2.0:          3.1 3.1 3.1 s
5.2.1-work1: 3.4 3.4 3.4 s

times (on older x86):
 5.1.4:          13 13 13 s
 5.2.0:          13.5 14 14 s
 5.2.1-work1: 19 19 19 s

Median string length (#s) is 24, and average length is 44.