gh-119182: Use public PyUnicodeWriter API in ga_repr() (#120799) · python/cpython@73b4492 · GitHub
Skip to content

Commit 73b4492

Browse files
authored
gh-119182: Use public PyUnicodeWriter API in ga_repr() (#120799)
The public PyUnicodeWriter API enables overallocation by default and so is more efficient. Benchmark: python -m pyperf timeit \ -s 't = list[int, float, complex, str, bytes, bytearray, ' \ 'memoryview, list, dict]' \ 'str(t)' Result: 1.49 us +- 0.03 us -> 1.10 us +- 0.02 us: 1.35x faster
1 parent 31ce5c0 commit 73b4492

1 file changed

Lines changed: 35 additions & 33 deletions

File tree

Objects/genericaliasobject.c

Lines changed: 35 additions & 33 deletions

0 commit comments

Comments
 (0)