lua-users home
lua-l archive

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


2011/4/14 Axel Kittenberger <axkibe@gmail.com>:
>> The current table library isn't convenient to manage FIFOs
>> efficiently. Given a table containing some elements,
>
> Take a look at:
>  http://www.lua.org/pil/11.4.html
> Pretty efficient FIFO, isn't it?

Indeed :-)
Now I'm using a modified version that can pushright/popleft multiple
values, and I use it in Lanes to speed up linda data passing. Now,
according to some crude benchmarking, sending and reading one element
at a time in a linda, I get an average 75x speed boost. And with
batched sends and reads, it gets even faster than that, depending on
the batch sizes. I'll bet I could get even faster than that with the
modified table.remove and table.insert_multiple I proposed, that would
avoid calling select() to iterate over ...

-- 
Benoit.