| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize() with the new public PyBytesWriter API.
|
This is a performance critical function, please check that this has no slowdown on microbenchmark. |
Sorry, something went wrong.
Do you have advises on how to write such benchmark? Benchmarks on similar functions:
Creating a writer takes less than 30 ns, so time is dominated by I/O operations. |
Sorry, something went wrong.
|
I wrote a similar change to use PyBytesWriter in socket.socket.recv(): #139097 (comment) |
Sorry, something went wrong.
|
I am not worried about performance on this change. The more modern code (1) has the same complexity as the older code and (2) the CPU performance should already be dominated by the decryption that happens to generate the data being read in the first place - not our potential data copy if an internal resize were to move something. |
Sorry, something went wrong.
|
Merged, thanks for reviews. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Replace PyBytes_FromStringAndSize(NULL, size) and _PyBytes_Resize() with the new public PyBytesWriter API.