Skip to content

Performance advice #195

Open
Open
@peroket

Description

@peroket

Hello, first I want to say thank you for creating cobalt, it is exactly what I was looking for!

I would like to pick your brain to find a solution to my problem, which is that I want to introduce coroutines in my code, but I want to introduce the asynchronicity gradually, meaning at the moment very few parts of my code can actually be interrupted.

On top of that, I have a series of abstraction on top of the code that can actually interrupt, several layers of functions and classes until the very bottom. In my first try, I transformed everything that needed it to coroutines (so the ones that can actually interrupt and everything that calls it, which also has a different implementation of the same function through virtual that cannot interrupt, which changed almost every function), and it killed my performance, I guess because of creating so many coroutines that will anyway not interrupt.

Is there a way to introduce coroutines at the lowest part of my code without impacting the performance so much when not interrupting?

I saw for example that seastar has a "thread concept" with a future.get() method that will interrupt somehow without changing all the functions calling it, could I do something like that with cobalt?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions