| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
* Disable overallocation in _PyBytesWriter_CreateByteArray(). * Disable overallocation in _PyBytes_FormatEx() at the last write.
Benchmark: python -m pyperf timeit -s 's=(b"a" * 254 + b"%s"); arg=b"b"*100' 's % (arg,)'. Result: Mean +- std dev: [ref] 165 ns +- 4 ns -> [change] 147 ns +- 1 ns: 1.12x faster. It's 18 ns faster because we avoid a realloc(). |
Sorry, something went wrong.
|
@serhiy-storchaka: This change reintroduces the overallocate=0 micro-optimization in the PyBytesWriter API, but the API to disable overallocation is only available in the internal C API. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.