gh-148323: release the GIL in bytes.join when operands are immutable#148456
gh-148323: release the GIL in bytes.join when operands are immutable#148456picnixz wants to merge 3 commits intopython:mainfrom
bytes.join when operands are immutable#148456Conversation
|
Ideally, I'd like to run macrobenchmarks with this but I don't know how to do it so I'll ask someone I think knows @eendebakpt |
I'll have a look at it today or tomorrow |
|
Thanks! My gut feeling is that it won't decrease the performance but I'm more interested in knowing how much we gain for the NEWS entry. |
|
Please give me some time to review its correctness. |
| PyObject *bufobj = buffers[i].obj; | ||
| if (!bufobj || !PyBytes_CheckExact(bufobj)) { | ||
| drop_gil = 0; | ||
| } |
There was a problem hiding this comment.
| PyObject *bufobj = buffers[i].obj; | |
| if (!bufobj || !PyBytes_CheckExact(bufobj)) { | |
| drop_gil = 0; | |
| } | |
| if (drop_gil) { | |
| PyObject *bufobj = buffers[i].obj; | |
| if (!bufobj || !PyBytes_CheckExact(bufobj)) { | |
| drop_gil = 0; | |
| } | |
| } |
There was a problem hiding this comment.
I don't think it'll matter much honestly. I'll wait for benchmarks in this case. Most of the time will be spent in memcpy() and the rest.
|
The rest LGTM! |
What exactly do you want to benchmark? Possible regressions during normal usage of I created a script to test the releasing of the GIL (included in the details below). It shows that Script for testing scaling |
Oh. I thought it would have been. Hum, then when do we have a buffer for which the underlying |
I wanted to konw whether the comparisons affected the general |
(I wanted to test both) |
Uh oh!
There was an error while loading. Please reload this page.