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

  • From: Mike Pall <mike-1411@xxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Fri, 7 Nov 2014 13:18:58 +0100

Tudor Bosman wrote:
> I suspect this has something to do with the way strings are hashed, but I
> haven't dug any deeper.

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).

Lua doesn't make a distinction between symbols and strings, which
makes it rather difficult to fully cater for the typical needs of
both types (which are quite different).

--Mike

Other related posts: