lua-users home
lua-l archive

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


I tested Lua 5.2.1-work1 on my app, which uses Lua with LPEG to do
parsing of renderer scene files.  It reads entire files into single Lua
strings and then hands those strings to LPEG to parse.  Parsing does
various string manipulation on the substrings from LPEG callbacks.  The
"file strings" can be very large, although they are never used as table
keys by themselves.

Here are the results; 5.2.1-work1 seems to be basically the same as
5.2.0, although the difference in memory from 5.1.4 seems a bit
worrying...

This is an x86-64 system running Debian.


Lua versions tested:
   luajit2.0.0-beta9 (system dynamic library)
   lua5.1.4 (compiled from source, -O3 -flto)
   lua5.2.0 (compiled from source, -O3 -flto)
   lua5.2.1-work1 (compiled from source, -O3 -flto)


Test cases:

(1) "plants-dusk.pbrt" (Total large strings 208MB, max large string 88MB)

Lua version       ParsingCPU TotUserCPU  TotSysCPU    Elapsed     MaxRSS
------------------------------------------------------------------------
luajit2.0.0-beta9      15.3s      18.3s       0.9s      19.3s      0.4GB
lua5.1.4               20.7s      24.2s       0.6s      23.7s      0.5GB
lua5.2.0               17.7s      20.7s       0.8s      20.4s      0.7GB
lua5.2.1-work1         16.7s      20.1s       0.8s      19.7s      0.7GB

[Average of 3 runs.]


(2) "sanmiguel_cam14.pbrt" (Total large strings 596MB, max large string 331MB)

Lua version       ParsingCPU TotUserCPU  TotSysCPU    Elapsed     MaxRSS
------------------------------------------------------------------------
luajit2.0.0-beta9     120.6s     120.2s       5.0s     135.3s      1.6GB
lua5.1.4              140.4s     142.7s       2.6s     145.4s      1.6GB
lua5.2.0              143.0s     147.0s       9.1s     287.0s      3.1GB
lua5.2.1-work1        143.0s     146.3s       9.1s     294.0s      3.2GB

[Average of 5 runs; this system only has 4GB so it consistently
started to thrash during the Lua 5.2 runs.  Although Lua 5.2.0 and
5.2.1-work1 seem basically equivalent, and roughly similar to Lua
5.1.4 in terms of CPU usage, the 5.2 variants both used _twice_ as
much memory as Luajit or Lua 5.1.4... (is the 5.2 GC really that
different?)]


Notes:

* That the "MaxRSS" numbers above should be taken with a grain of
  salt -- they are derived from the GNU time "maxresident" value,
  but that value seems to be consistently wrong by about a factor of
  four, judging from what other utilities report (and common sense,
  regarding the thrashing threshold).  So I've just divided what GNU
  time says by 4.

* The "ParsingCPU" number includes non-Lua stuff, and both user and
  system times, but a large part of it is Lua and LPEG.  The "Total"
  and "Elapsed" times include rendering, but the latter should be
  pretty minimal.


Thanks,

-miles

-- 
「すっごい」と呟いてる。「へんてこなもんばっかり」
「そんなにへんてこ?」
「へんてこへんてこ」
そう言われると見たくなってしまう。