-
-
Notifications
You must be signed in to change notification settings - Fork 110
Add More Multidict Functions C-API #1190
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
base: capi
Are you sure you want to change the base?
Conversation
CodSpeed Performance ReportMerging #1190 will not alter performanceComparing Summary
|
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.
#1185 (review) review has a lot of comments that are not applied to this PR yet.
Could you please address it, or should I move these comments to the PR?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Tomorrow Or Later I will see about tracking down the gc/weakref bug. |
@asvetlov I'm back. I woke up. I ran pre-commit install inside my env. |
@asvetlov When I run pre-commit run --all-files here's what I get
|
Ok so it appears all I have left is documentation according to the linter this should be an easy one to fix seems I had some spelling errors when I was writing late at night. |
@asvetlov It's failing to built the wheels for mac-os for some strange reason but I will wait for you to get back before I do anything else... |
@asvetlov Workflow seems to be ignore testcapi but I'm sure you'll find a way to get it to run. |
Codecov ReportAttention: Patch coverage is
❌ Your patch check has failed because the patch coverage (0.43%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## capi #1190 +/- ##
==========================================
- Coverage 97.57% 96.12% -1.46%
==========================================
Files 28 28
Lines 4125 4335 +210
Branches 736 738 +2
==========================================
+ Hits 4025 4167 +142
- Misses 52 119 +67
- Partials 48 49 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sorry, this evening I was busy preparing the 6.5.1 bugfix release. |
So I have a theory on what caused multidict/multidict/_multilib/capsule.h Line 33 in ddbbf68
The problem may be tied to how Multidict is setup to first allocate memory. multidict/multidict/_multidict.c Line 911 in ddbbf68
Looking at PyObject *
PyType_GenericNew(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
return type->tp_alloc(type, 0);
} Replacing
My bad I'll wait for tomorrow, I apologize. |
Yes, you are right. Better to call |
@asvetlov I'll leave the rest to you now, now that I've replaced the |
Ok. |
Alright, makes sense I'll see about removing this one here in a bit. |
@asvetlov I'm going to see about resolving a few conflicts today with this repo and |
@asvetlov I'll make sure your done with your benchmarks pr and then I will proceed. |
I've done, benchmarks are stable now. |
@asvetlov Sounds good let me sync what I need to sync |
While I was looking how the new iterator I made I think I'm going to see if the http_writer.pyx module from aiohttp could be moved to C so that it has a lower-level footprint with only one function ever getting called. I'll make it into possibly a separate repo temporarily but it will utilize the new tech we worked on. |
Maybe, let's see. Actually, Cython which utilizes multidict C API could be good enough |
I have 1 script that can generate the cython-api but I haven't added it yet due to mypy hating my script. However it uses libclang and types-clang to get the job done. I was inspired by rust's bindgen tool to build my own. Here's my concept for optimizing the http-writer further with the new multidict c-api. |
@asvetlov I think I'm going to move some of the iterator functions over to something like |
Can't wait to see 6.7 be released. Do we still want to add cython to it or should be cram that into 6.8? |
Seems I added Cython in by accident but feel free to let me know if it shouldn't be autogenerated. A Handful of edits will likely fix that. |
I added in my Cython script generator in because the |
@asvetlov I wanted to provide cython support by the next update and I was wondering if I should go and document that portion of code or try moving away from trying to autogenerate that portion of code. |
…with cython in aiohttp
@asvetlov I ran some benchmarks in another pull request that is waiting for us to finish this up but if it inspires you to continue there's an almost 40% Performance increase in the |
@asvetlov Sorry for asking about this so suddenly but I am having problems adding the testcapi to the workflow and I was wondering if you had the time to help? I need to figure out a way to compile testcapi but using the current library rather than needing to fetch or have to point to a git url. I guess the second thing I wanted to ask is if were going to resume this, I had some ideas with the new C-API outside of aiohttp that may involve yarl receiving more optimized functionality such as moving the URL object into Cython, the second project I had planned with this was a new msgspec conversion library using multidict for parsing server related things like payloads query parameters and transforming them to dataclasses. |
Hi! |
No problem thanks for letting me know. I did resume my IRL job recently so just a heads up but it should not restrain me from continuing to contribute here. |
What do these changes do?
The summary of #1185 should suffice but basically the pr was accidently merged then deleted luckily I had a backup of the original code on hand so that we can resume where we left off.
Are there changes in behavior for the user?
Changes mainly will involve everything explained in #1185 but given with some better details and other suggestions from other contributors will go into this one.
Related issue number
Checklist