Quote:
Originally Posted by Jobbo
Very interesting to see co-routines in use on Amiga. I haven't used them myself in other projects but I've seen the concept used in games at least as far back as 1998.
What is the overhead like for yielding and continuing on the Amiga? Is the optimizer able to inline everything to such an extent that it only needs to save a partial context?
|
Regarding overhead for continuing a coroutine:
A jumptable call is used as indirection on each resume (if you have more then one co_yield). So the overhead compared to a normal function call is negligible (at least compared with a function that would need to save/restore all registers).
Another feature i didn't talk about was the use of
lambdas in Wrong Way Driver. Those imposed no performance penalty and helped a lot to shorten the code and make it more readabale.
Lambdas are great for callbacks or short 'throw away' code snippets that you don't need in a function.