Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance ideas/roadmap #2844

Open
lmcd opened this issue Aug 15, 2024 · 4 comments
Open

Performance ideas/roadmap #2844

lmcd opened this issue Aug 15, 2024 · 4 comments

Comments

@lmcd
Copy link

lmcd commented Aug 15, 2024

I see often in benchmarks that SwiftNIO seems to perform worst than most other things out there.
I expect this will probably get better over time.

It would be very useful for me and other advocates of swift-nio to have a write-up somewhere in the repo/wiki of the current state of play, performance penalties etc, some potential strategies to overcome these challenges, future Swift features that may improve things, how things like Io_uring could change the performance picture, what impact a full transition to Swift Concurrency might have etc.

I occasionally see threads like these on the Swift forums and find them very detailed and insightful. Things like this are beyond my usual level of expertise, so I think it'd be useful for someone with this information to present it for others to see.

Just a thought! 🙂

@lmcd lmcd changed the title Performance ideas/roadmap> Performance ideas/roadmap Aug 15, 2024
@Lukasa
Copy link
Contributor

Lukasa commented Aug 15, 2024

This is not a bad idea.

For what it's worth, SwiftNIO's perceived performance issues are not really reflective of where it's at. Instead, they're reflective of the size of the relative communities. Producing a good benchmark result is less about the framework and much more about tuning to the benchmark. NIO's defaults are designed to make it safe, not to make it fast, and so without some work to configure it NIO doesn't necessarily perform to its best.

But even then, the reality is that NIO is faster than essentially anyone in the community needs it to be. My view is that performance is not NIO's problem: actually, we could probably burn some performance at the cost of ergonomics.

@Lukasa
Copy link
Contributor

Lukasa commented Aug 15, 2024

A very useful thing community members could do, actually, is to write implementations of particular benchmarks and propose them for review here, or inclusion as examples in swift-nio-examples. This would allow for community collaboration on those benchmarks, which can help with turning around that benchmark perception.

@lmcd
Copy link
Author

lmcd commented Aug 16, 2024

But even then, the reality is that NIO is faster than essentially anyone in the community needs it to be.

We're trying to push many Gbps through it 🙂 As in large, concurrent file transfer operations. We're not hitting any walls yet, but may eventually turn our focus to throughput as we scale.

@Lukasa
Copy link
Contributor

Lukasa commented Aug 16, 2024

That should be no problem whatsoever. When you do start hitting some bottlenecks, let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants