From: miguel s. <mig...@gm...> - 2010-08-27 21:52:11
|
On 08/27/2010 06:41 PM, Neil Madden wrote: > <snip> The one drawback is > that coroutine context switches are quite slow at present. Definitely an > area for optimisation prior to 8.6 final. Do you havr evidence for that? I never measured, but: * a yield should be a tad slower than a return (return is bc'ed, yield is not) * a resume should be in the same order of magnitude as a proc call, slighty faster * a yieldto is indeed likely to be a bit slow: not bc'ed, a bit of callback stack juggling. It is probably slower than a proc call, but a big part of the difference should be recovered at the end: yieldto causes the caller's stack data to be cleaned up earlier, but it will eventually have to be cleaned up anyway. |