Ideas for RSGI 2.0: reducing Python object overhead & moving more work to Rust #767
Replies: 1 comment 1 reply
-
|
I'm a bit confused on the premise, as you say:
but, even if that's true – not sure where this premise comes from – RSGI and Granian never interact with the networking stack in the Python side of things. So when you say:
I'm not sure what do you mean, given Python networking plays 0 role in RSGI. Also, when you say
do you have any numbers that validate this? Or, in other words, how can you be sure the bottleneck in RSGI is object marshaling without any profiling? 'cause to my knowledge, the biggest bottleneck in Granian (and thus also in the RSGI protocol) are GIL acquisition time and/or contention, and |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
With recent Python releases, networking and async I/O on the Python side have been getting consistently faster. As a result, the performance bottleneck for Rust-based servers seems to shift away from networking towards Rust/Python boundary, especially around serialization and object marshaling
And RSGI 1.X relies on creating and passing a fair number of Python objects (scopes, headers, protocol wrappers, etc.) per request.
I'm opening this issue to to hear maintainers’ and other contributors’ perspectives and to start an open discussion around whether a future RSGI 2.0 could push more work fully into Rust and further reduce Python object involvement.
Possible directions (not a concrete proposal yet):
This is a purely exploratory idea. I don’t currently have concrete issues with RSGI as it exists today. These thoughts came up while reading through how RSGI works and thinking about where future bottlenecks might move as Python networking performance continues to improve.
Thanks for your work and attention!
Note: this text was written with help of AI, so I apologise in advance if it feels weird
Beta Was this translation helpful? Give feedback.
All reactions