summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-03-26 07:56:23 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-03-26 07:56:23 (GMT)
commit707483fdef1dcb91e5239f7dd16db509ce2737c7 (patch)
tree041e73c31c45e9f900c99cd9b29818abfa2db3c5 /Doc
parent4b49823eddd7c10f653acb4b6fbb2c32bfc70499 (diff)
downloadcpython-707483fdef1dcb91e5239f7dd16db509ce2737c7.zip
cpython-707483fdef1dcb91e5239f7dd16db509ce2737c7.tar.gz
cpython-707483fdef1dcb91e5239f7dd16db509ce2737c7.tar.bz2
Update timeit example to reflect current performance.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tut/tut.tex6
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tut/tut.tex b/Doc/tut/tut.tex
index 9fdf228..d214e7f 100644
--- a/Doc/tut/tut.tex
+++ b/Doc/tut/tut.tex
@@ -4634,14 +4634,14 @@ immediately.
For example, it may be tempting to use the tuple packing and unpacking
feature instead of the traditional approach to swapping arguments.
The \ulink{\module{timeit}}{../lib/module-timeit.html} module
-quickly demonstrates that the traditional approach is faster:
+quickly demonstrates a modest performance advantage:
\begin{verbatim}
>>> from timeit import Timer
>>> Timer('t=a; a=b; b=t', 'a=1; b=2').timeit()
-0.60864915603680925
+0.57535828626024577
>>> Timer('a,b = b,a', 'a=1; b=2').timeit()
-0.8625194857439773
+0.54962537085770791
\end{verbatim}
In contrast to \module{timeit}'s fine level of granularity, the