-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
feat: get rid of intermediate representations of requests and responses #397
feat: get rid of intermediate representations of requests and responses #397
Conversation
✅ Deploy Preview for robyn canceled.
|
@AntoineRR , I think this PR will conflict with #363 . |
Yes probably, we should merge the other PR prior to this one and I'll do the corrections after. This PR is not ready anyway for now |
64e74a6
to
a2a3a8a
Compare
@sansyrox, I have something that works now.
If you have any idea on how to fix this, let me know ! |
a2a3a8a
to
9f3f7f2
Compare
Hey @sansyrox, I improved the way the body is handled in this PR, using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great work @AntoineRR 😄
I have a few comments at the PR and I will also try to do another review tomorrow 😅
697e4a8
to
857f894
Compare
Hey @sansyrox, thanks a lot for the great suggestions. I updated the code. |
Hey @AntoineRR 👋 Firstly, thank you for the amazing work! 😄 Regarding your query -> Actually |
@sansyrox I think we have to acquire the GIL to perform any operation on the headers when it's wrapped in a |
@AntoineRR , I wouldn't worry too much about it as I was going through the codebase and we can optimize this by GIL batching(something that is highly due). And I believe this will provide a much better interface to work with. And good developer experience is the top most priority imo |
What do you mean by "GIL batching"? Does this mean you want to provide a way to perform several operations at once while holding the GIL? |
exactly!
I believe this will be a temporary drop in performance and we can fix it in the upcoming releases. |
Ok I could try it like this. |
@AntoineRR , I think this approach will be faster than acquiring and releasing GIL on edits. Do you think we should start from this? |
I think it should be faster too. Let's try this idea then! I will work on this in the following days and keep you updated here. |
@AntoineRR ,sounds great 😊 |
Hey @AntoineRR 👋 I just added this (#443) . It will now eliminate the guessing of performance 😄 |
857f894
to
9b03a9c
Compare
Nice, thanks! That's good to know 😉 |
9b03a9c
to
def315b
Compare
CodSpeed Performance ReportMerging #397 Summary
Benchmarks breakdown
|
Hey @AntoineRR 👋 I hope all's good. Is this PR up for review? |
Hey @sansyrox, no I'm still working on this. I'll assign you as a reviewer once the PR is ready |
def315b
to
6827c5d
Compare
Hey @sansyrox, I finally achieved what I wanted! The PR is ready for a first review, or you can wait until I rebased everything correctly (I see there is a new conflict with the latest commit). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @AntoineRR 😄
I have some initial questions. I will complete the review soon 😄
7d34617
to
450cad1
Compare
@sansyrox I rebased the branch and applied your recommendations 🙂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @AntoineRR ,
I have one more question here. I will have give it a final review tomorrow. And then we can merge it 😄
450cad1
to
64a24db
Compare
64a24db
to
927be29
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work @AntoineRR 😄
This PR was intense 🔥
Description
This PR is a draft to pass a
Request
andResponse
struct to the Python routes (Response
is used in the "after" middleware).Currently, I managed to do it, but unfortunately the body of the
Request
andResponse
objects is wrapped in theActixBytesWrapper
struct so it is unusable on Python's side.This will be a breaking change, as the response and request objects you get from Python's struct won't be dictionaries anymore. This would be used like this:
instead of this: