[Python-ideas] string codes & substring equality

Terry Reedy tjreedy at udel.edu
Thu Nov 28 00:42:34 CET 2013


On 11/27/2013 4:30 PM, spir wrote:

> No, but I'll keep this idea aside if ever I really need improved
> performance in general. For now, I just tried to avoid unneeded object
> creations, and this at the core points of a parsing process.

It is well known that the simplicity of 'everything is an object' has a 
cost, including the otherwise useless boxing and unboxing of temporary 
values that are machine objects (int, floats, char arrays). Others have 
already pointed out that the core developers who added .start(end)swith 
added optional params to avoid this.

The Psyco (Python specializing compiler) extension package speeds 
appropriate Python code by more generally avoiding unneeded boxing.
https://pypi.python.org/pypi/psyco/1.6
(I think it is Py2 only.) This extension was the basis for the PyPy JIT

If you have a few specialized functions you need to accelerate, you can 
make your own extension. Cython apparently makes this fairly easy. And 
there are other tools.

-- 
Terry Jan Reedy



More information about the Python-ideas mailing list