-
Notifications
You must be signed in to change notification settings - Fork 108
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
Compared performance to gRPC with heavy payloads #674
Comments
@rchoffardet hi, sorry, I just read this comment. Couple things:
A few questions I'd like to ask:
I'd do a couple extra things:
Overall, it makes sense to find out what's the bottleneck in both these cases. It's easy with ActualLab.Rpc - all you need is to profile your test. I'd bet that if your client & server are on the same machine, most likely it's UTF8 transcoding, and probably gRPC does it slightly faster. This doesn't tell it's faster in general, of course. The larger are your messages, the less RPC library can do to efficiently transmit them, assuming we're talking about the real networking & same-size wire payload per message. I.e. the larger is payload, the less noticeable is the overhead RPC library adds + the more likely that your network connection is the bottleneck. And if we're talking about really large payload, more likely than not you'll end up splitting it into chunks to process it sooner, implement resume on disconnect, etc. - i.e. more likely than not you'll end up streaming it with Fusion also "pushes" you to implement APIs producing small or medium-size payloads. The more precise your invalidations + the less payload you have to re-send once it happens, the better. So large payload tests are important only to some extent. |
@rchoffardet if you'd end up continuing the investigation, please create a similar issue in https://github.com/ActualLab/Fusion repo ; and I'll be happy to help. |
@rchoffardet just updated https://github.com/ActualLab/Fusion.Samples to the latest Fusion version, and even though the RPC perf there seem to be even higher now, I confirm that it degrades with larger stream items (compared to gRPC & SignalR) - i.e. it's noticeably faster on 100-byte items, but slightly slower on 10KB items. I'll investigate. |
@rchoffardet I investigated what's going on - overall, gRPC seem to have less memory copying while handling And if you think about the test that streams large byte arrays locally, copying is ~ all that matters there. Real-life scenario is very different: NIC bandwidth or some other IO is way more likely to be a bottleneck in this case. I'll probably try to go a bit further in terms of optimizing ActualLab.Rpc specifically for this scenario, but overall, I don't see a huge value in doing this: it's on par with SignalR on large byte arrays, and IMO the scenarios with small & medium-sized items are much more important. |
Hey 👋🏻
Firstly, thanks for your invested efforts and the openly publishing of your library.
This "issue" isn't really an issue, it's more like a conversation :)
My team and I are interested in alternative to gRPC such as your library and with the claimed performance improvement, it looked very promising.
However, I played a bit with your benchmark and found that with heavier load (10kB and 100kB) Slt.Fusion performs worse than gRPC on my machine (the payload is just a constant random string) whereas it's a known weakness of gRPC.
Light is 1kB, Medium is 10kB and Heavy is 100kB.
Do you observe similar relative numbers? Am I doing something wrong?
Regards
The text was updated successfully, but these errors were encountered: