Hi, William Stein wrote: > On Wed, Mar 5, 2008 at 11:18 AM, Stefan Behnel <[EMAIL PROTECTED]> wrote: >> I got most of pybench running (as shipped with Python 2.5.1), just had to >> rename the .py files to .pyx (except Setup.py) and fix some "*" imports in >> the >> configuration, Cython does not allow that. > > Just out of curiosity could you use Pyrex (instead of Cython) to run > all the same benchmarks? I'm very curious how much the optimizations > that were added to Cython have impacted performance on these > sorts of things.
Want a number? 11% :) I also attached the sources I used. Stefan
************************************************************************
**This file compares Pyrex 0.9.6.4 (this) with Cython 0.9.6.12 (other) **
************************************************************************
-------------------------------------------------------------------------------
PYBENCH 2.0
-------------------------------------------------------------------------------
* using Python 2.5.1
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.time
Creating benchmark: pyrexbench.log (rounds=10, warp=10)
Calibrating tests. Please wait...
Running 10 round(s) of the suite at warp factor 10:
* Round 1 done in 3.903 seconds.
* Round 2 done in 3.940 seconds.
* Round 3 done in 3.969 seconds.
* Round 4 done in 3.967 seconds.
* Round 5 done in 4.223 seconds.
* Round 6 done in 3.924 seconds.
* Round 7 done in 3.994 seconds.
* Round 8 done in 3.912 seconds.
* Round 9 done in 3.910 seconds.
* Round 10 done in 3.987 seconds.
-------------------------------------------------------------------------------
Benchmark: pyrexbench.log
-------------------------------------------------------------------------------
Rounds: 10
Warp: 10
Timer: time.time
Machine Details:
Platform ID: Linux-2.6.22-14-generic-i686-with-debian-lenny-sid
Processor:
Python:
Executable: /usr/bin/python
Version: 2.5.1
Compiler: GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Bits: 32bit
Build: Oct 5 2007 13:36:32 (#r251:54863)
Unicode: UCS4
-------------------------------------------------------------------------------
Comparing with: cybench2.log
-------------------------------------------------------------------------------
Rounds: 10
Warp: 10
Timer: time.time
Machine Details:
Platform ID: Linux-2.6.22-14-generic-i686-with-debian-lenny-sid
Processor:
Python:
Executable: /usr/bin/python
Version: 2.5.1
Compiler: GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)
Bits: 32bit
Build: Oct 5 2007 13:36:32 (#r251:54863)
Unicode: UCS4
Test minimum run-time average run-time
this other diff this other diff
-------------------------------------------------------------------------------
CompareFloats: 0ms 0ms -29.7% 0ms 0ms -29.1%
CompareFloatsIntegers: 0ms 0ms +52.2% 0ms 0ms -25.0%
CompareIntegers: 0ms 0ms -9.7% 0ms 0ms +45.3%
CompareInternedStrings: 27ms 51ms -46.9% 31ms 52ms -41.4%
CompareLongs: 588ms 598ms -1.7% 590ms 603ms -2.2%
CompareStrings: 244ms 87ms +181.5% 245ms 87ms +179.9%
ConcatStrings: 226ms 221ms +2.3% 247ms 227ms +8.6%
CreateStringsWithConcat: 155ms 155ms +0.1% 157ms 156ms +0.9%
DictCreation: 74ms 63ms +16.8% 74ms 65ms +14.9%
DictWithFloatKeys: 194ms 191ms +1.3% 229ms 196ms +17.1%
DictWithIntegerKeys: 69ms 65ms +6.1% 70ms 65ms +7.8%
DictWithStringKeys: 55ms 50ms +10.5% 58ms 50ms +14.6%
ForLoops: 48ms 22ms +119.3% 49ms 22ms +122.2%
IfThenElse: 49ms 48ms +2.3% 52ms 48ms +8.0%
ListSlicing: 121ms 121ms -0.3% 126ms 122ms +2.6%
NestedForLoops: 67ms 17ms +307.7% 68ms 17ms +308.9%
SecondImport: 161ms 161ms +0.1% 162ms 162ms -0.3%
SecondPackageImport: 166ms 168ms -1.0% 167ms 169ms -0.9%
SecondSubmoduleImport: 200ms 202ms -0.9% 202ms 204ms -1.3%
SimpleComplexArithmetic: 140ms 142ms -1.1% 141ms 142ms -0.7%
SimpleDictManipulation: 90ms 85ms +6.1% 91ms 85ms +6.5%
SimpleFloatArithmetic: 86ms 85ms +1.3% 89ms 87ms +2.3%
SimpleIntFloatArithmetic: 53ms 53ms +0.5% 53ms 53ms -0.3%
SimpleIntegerArithmetic: 52ms 51ms +1.6% 52ms 52ms +1.5%
SimpleListManipulation: 83ms 37ms +122.6% 88ms 38ms +131.3%
SimpleLongArithmetic: 108ms 107ms +0.9% 112ms 109ms +3.5%
SmallLists: 99ms 78ms +26.2% 99ms 79ms +25.6%
SmallTuples: 150ms 80ms +87.1% 150ms 81ms +86.3%
StringMappings: 130ms 124ms +4.7% 131ms 125ms +4.6%
StringPredicates: 133ms 117ms +13.5% 136ms 121ms +13.0%
StringSlicing: 94ms 93ms +0.4% 95ms 96ms -0.6%
TryExcept: 0ms 0ms -45.3% 0ms 0ms -33.4%
TryRaiseExcept: 88ms 80ms +10.2% 90ms 81ms +10.8%
TupleSlicing: 117ms 116ms +0.7% 118ms 117ms +0.4%
-------------------------------------------------------------------------------
Totals: 3868ms 3468ms +11.5% 3973ms 3512ms +13.1%
(this=pyrexbench.log, other=cybench2.log)
cybench.tgz
Description: application/compressed-tar
_______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
