Boost logo

Boost :

Subject: Re: [boost] Push/pull parsers & coroutines
From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2017-10-14 18:04:10


Seth wrote:
> coroutines are not zero cost

In some cases they can have negative cost. See Gor
Nishanov's CppCon 2015 presentation, "C++ Coroutines - a
negative overhead abstraction".

With coroutines, the state is essentially a program counter
value which can be saved and restored with similar cost to a
function call or return. When the alternative is something
like a state enum and a switch statement, the coroutine is
going to win.

Regards, Phil.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk