View Single Post
Old 21 April 2021, 16:40   #8
Registered User
Join Date: Aug 2018
Location: Untergrund/Germany
Posts: 358
Originally Posted by Jobbo View Post
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.
pink^abyss is offline  
Page generated in 0.07307 seconds with 11 queries