[NeedForSpeed] [Python-checkins] r46083 - sandbox/trunk/stringbench sandbox/trunk/stringbench/stringbench.py
Andrew Dalke
dalke at dalkescientific.com
Tue May 23 13:18:03 CEST 2006
> [M.-A. Lemburg]
>> Why don't you add these to pybench which is now part of Python
>> (see Tools/pybench/) ?!
Tim:
> We were wondering about that :-) If it's OK by you, we'd like to add
> several new tests to pybench.
Feel free to add any of the tests to pybench.
The goal of stringbench is a bit different than pybench. We wanted
a head-to-head comparison of byte string performance and unicode
string performance, as well as a way to compare different methods
which give different ways to compute the same thing
For example, here are three tests for splitting on newline
========== split 2000 newlines
723.01 871.26 83.0 "...text...".rsplit("\n") (*100)
104.61 237.68 44.0 "...text...".split("\n") (*100)
106.18 280.76 37.8 "...text...".splitlines() (*100)
This suggests that the unicode splitlines could get a
speed boost because it's almost 1/3rd the speed of the
byte implementation. ("Suggests" because the numbers /F
gets on his new Intel box are rather different than my
oldish PPC.)
Andrew
dalke at dalkescientific.com
More information about the NeedForSpeed
mailing list