Slow String Repeat (was: [Python-Dev] PyBuffer* vs. array.array()) (original) (raw)
Raymond Hettinger python@rcn.com
Mon, 6 Jan 2003 09:50:07 -0500
- Previous message: Slow String Repeat (was: [Python-Dev] PyBuffer* vs. array.array())
- Next message: Slow String Repeat (was: [Python-Dev] PyBuffer* vs. array.array())
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
From: "Christian Tismer" <tismer@tismer.com>
I could imagine not to change string repeat and others, but the abstract implementation of the repetition of a sequence. An algorithm like the above could be written for general sequences, and do this break-up on the abstract level, once and for all repetitions of arbitrary objects.
Something similar can be done for arraymodule.c The use cases there may involve longer than normal repetition counts so some attention should be paid to cache invalidation.
In other places, there is less of an opportunity since replication involves more than copying (there are Py_INCREFs to worry about).
Raymond Hettinger
- Previous message: Slow String Repeat (was: [Python-Dev] PyBuffer* vs. array.array())
- Next message: Slow String Repeat (was: [Python-Dev] PyBuffer* vs. array.array())
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]