Re: Data-dependent slowdown in loop involving io.lines()

  • From: Joshua Jensen <jjensen@xxxxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 07 Nov 2014 10:24:52 -0700

Tudor Bosman wrote on 11/7/2014 9:09 AM:

On Fri Nov 07 2014 at 4:20:02 AM Mike Pall <mike-1411@xxxxxxxxxx <mailto:mike-1411@xxxxxxxxxx>> wrote:


    A sparse hash inevitably shows worst case behavior like this. It's
    just a matter of trying hard enough to find such an example (with
    either Lua or LuaJIT).


The point is that we didn't try hard enough; the example I gave is contrived, but that's only because I didn't want to show our full pathnames in the example (also, because I didn't want to attach the original 98MB file).
This is not uncommon. The data set I work with (tens of thousands of filenames) has Lua 5.1 running many *times* faster than LuaJIT.

I'd love to see LuaJIT's string internals improved, too.

-Josh

Other related posts: