lua-users home
lua-l archive

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


On 16.11.2010 08:53, mail@umaxx.net wrote:
> Hi,
> 
> Am 04.11.2010 um 19:24 schrieb Petite Abeille:
> 
>>> can someone show me how to (re-)implement the pairsByKeys()-iterator from
>>> PIL sorting chapter (19.3) using coroutines?
>>
>> Hmmm... not sure if this makes much sense, but, for example:
>>
> 
> Thank you very much.
> Made some minor/simple performance measurements and it seems like it makes
> not much difference even for very very big tables.

So what were you expecting then, and why? The coroutines version adds a
slight overhead with yield/resume (its like calling a function).

You may be mistaking coroutines with system threads; for that you should
check luaproc, concurrentlua, alua, lua lanes etc. Check this out:
http://kotisivu.dnainternet.net/askok/bin/lanes/comparison.html

(but then watch out for message passing/communication/serialization
overhead)

Regards,
miko