[New-bugs-announce] [issue1943] improved allocation of PyUnicode objects

Antoine Pitrou report at bugs.python.org
Sat Jan 26 23:44:35 CET 2008

New submission from Antoine Pitrou:

This is an attempt at improving allocation of str (PyUnicode) objects.
For that it does two things:
1. make str objects PyVarObjects, so that the object is allocated in one
pass rather than two
2. maintain an array of freelists, each for a given str length, so that
many str allocations can bypass actual memory allocation calls

There is a ~10% speedup in stringbench, and a slight improvement in
pybench (as invoked with "./python Tools/pybench/pybench.py -t String").
Also, memory consumption is a bit lower when running those benchmarks.

components: Interpreter Core
files: unialloc.patch
messages: 61728
nosy: pitrou
severity: normal
status: open
title: improved allocation of PyUnicode objects
type: rfe
versions: Python 3.0
Added file: http://bugs.python.org/file9296/unialloc.patch

Tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list