lua-users home
lua-l archive

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

> In Stackless Python, switching to a coroutine is much faster than a
> function call, since the frame is already allocated and set up. I had
> hoped this was true in Lua also.

You must remember that function calls in Lua are much faster than in
Python, and so it is easier for coroutines in Python to be faster than
function calls ;-).

In a quick-and-dirty "benchmark" it seems that coroutine switching in
Lua is as fast as function calls, except that coroutines do not return
straight, but need an "extra" call (to yield) to "return".

-- Roberto