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

  • From: Coda Highland <chighland@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Tue, 11 Nov 2014 14:41:45 -0800

On Tue, Nov 11, 2014 at 2:23 PM, soumith <soumith@xxxxxxxxx> wrote:
> Considering this as a non-issue is quite irresponsible especially when the
> case is quite general and would be encountered by quite a few people.

This isn't really calling it a "non-issue." What's actually being said
is that it's essentially UNAVOIDABLE. There are tradeoffs to be made,
and in any string-hashing system there's ALWAYS going to be some
pathological worst-case behaviors that come up. And not hashing the
string would cause worse behaviors in other places. Somewhere has to
win, somewhere has to lose.

If your behavior hits this path, there are ways to sidestep it. I gave you one.

/s/ Adam

Other related posts: