Re: Found a case where slower than plain lua

  • From: Daurnimator <quae@xxxxxxxxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Wed, 1 Apr 2015 15:06:39 +1100

On 1 April 2015 at 14:35, William Adams <william_a_adams@xxxxxxx> wrote:

Did I totally miss the point, or could this be an option:


http://www.pceworld.com/view/18843610


Basically using a table, but with continuous indexing. It's a list, you can
create a queue by pushing/popping from either end.

That was actually the original implementation that Mike Pall said was
a bad idea.
Incidentally, I had no idea this was in PiL.


Also, with {} construction included in your timing, as well as garbage
collection, I'm not quite sure what's being measured here.

Are you trying to measure the performance of the queue, or the garbage
collector, or the table constructor?

This is on purpose
- I expect the linked list approach is faster at run time but
creates a lot more garbage, I wanted gc to be included in the
measurements
- I didn't use a number, as I wanted to reflect the normal case of
the value not fitting in a TValue.

Other related posts: