[Python-Dev] [ANN] VPython 0.1
skip at pobox.com
skip at pobox.com
Wed Oct 22 20:18:26 CEST 2008
J> I implemented a variant of the CPython VM on top of Gforth's Vmgen;
J> this made it fairly straightforward to add direct threaded code and
J> superinstructions for the various permutations of LOAD_CONST,
J> LOAD_FAST, and most of the two-argument VM instructions.
Skip> Trying to build with your changes on my Mac (OS X 10.5.5) I get an
Skip> error caused by a definition in code.h:
I renamed Cell to _PyV_Cell and Inst to _PyV_Inst and got it to build. I
get this pybench output on my Mac:
-------------------------------------------------------------------------------
PYBENCH 2.0
-------------------------------------------------------------------------------
* using Python 2.5.3a0
* disabled garbage collection
* system check interval set to maximum: 2147483647
* using timer: time.time
-------------------------------------------------------------------------------
Benchmark: py25t.pybench
-------------------------------------------------------------------------------
Rounds: 10
Warp: 10
Timer: time.time
Machine Details:
Platform ID: Darwin-9.5.0-i386-32bit
Processor: i386
Python:
Executable: /Users/skip/src/python/release25-maint/python.exe
Version: 2.5.3a0
Compiler: GCC 4.0.1 (Apple Inc. build 5465)
Bits: 32bit
Build: Oct 22 2008 13:12:03 (#release25-maint:66444M)
Unicode: UCS2
-------------------------------------------------------------------------------
Comparing with: py25.pybench
-------------------------------------------------------------------------------
Rounds: 10
Warp: 10
Timer: time.time
Machine Details:
Platform ID: Darwin-9.5.0-i386-32bit
Processor: i386
Python:
Executable: /Users/skip/local/bin/python2.5
Version: 2.5.3a0
Compiler: GCC 4.0.1 (Apple Inc. build 5465)
Bits: 32bit
Build: Sep 13 2008 09:17:06 (#release25-maint:66444)
Unicode: UCS2
Test minimum run-time average run-time
this other diff this other diff
-------------------------------------------------------------------------------
BuiltinFunctionCalls: 119ms 133ms -10.6% 121ms 141ms -14.1%
BuiltinMethodLookup: 107ms 113ms -5.2% 108ms 116ms -6.5%
CompareFloats: 67ms 92ms -27.7% 68ms 95ms -28.4%
CompareFloatsIntegers: 75ms 92ms -17.9% 76ms 94ms -19.1%
CompareIntegers: 53ms 89ms -39.8% 54ms 91ms -40.6%
CompareInternedStrings: 78ms 102ms -24.3% 78ms 109ms -28.3%
CompareLongs: 64ms 85ms -24.2% 65ms 85ms -23.5%
CompareStrings: 60ms 77ms -22.0% 62ms 80ms -22.5%
CompareUnicode: 91ms 106ms -13.8% 93ms 111ms -16.0%
ConcatStrings: 140ms 141ms -0.3% 144ms 144ms +0.0%
ConcatUnicode: 83ms 82ms +2.4% 91ms 85ms +6.6%
CreateInstances: 138ms 145ms -5.1% 140ms 148ms -5.2%
CreateNewInstances: 123ms 128ms -3.7% 125ms 129ms -3.5%
CreateStringsWithConcat: 104ms 111ms -7.0% 105ms 258ms -59.1%
CreateUnicodeWithConcat: 81ms 93ms -13.2% 83ms 158ms -47.7%
DictCreation: 104ms 96ms +9.1% 106ms 102ms +4.0%
DictWithFloatKeys: 88ms 104ms -15.9% 92ms 110ms -16.4%
DictWithIntegerKeys: 79ms 111ms -29.2% 81ms 113ms -28.4%
DictWithStringKeys: 77ms 90ms -13.8% 84ms 93ms -9.8%
ForLoops: 66ms 78ms -15.2% 67ms 79ms -14.8%
IfThenElse: 57ms 91ms -37.4% 57ms 91ms -37.4%
ListSlicing: 119ms 120ms -0.4% 121ms 121ms -0.3%
NestedForLoops: 86ms 98ms -12.0% 87ms 99ms -12.5%
NormalClassAttribute: 113ms 111ms +2.1% 118ms 113ms +4.0%
NormalInstanceAttribute: 89ms 102ms -12.5% 91ms 104ms -12.6%
PythonFunctionCalls: 89ms 106ms -15.8% 91ms 108ms -15.0%
PythonMethodCalls: 141ms 158ms -11.0% 149ms 161ms -6.9%
Recursion: 122ms 137ms -11.2% 123ms 140ms -11.7%
SecondImport: 90ms 91ms -0.3% 91ms 91ms -0.3%
SecondPackageImport: 95ms 95ms +0.9% 97ms 96ms +0.9%
SecondSubmoduleImport: 124ms 124ms +0.5% 126ms 125ms +0.7%
SimpleComplexArithmetic: 96ms 103ms -7.2% 97ms 105ms -6.8%
SimpleDictManipulation: 85ms 101ms -15.6% 90ms 103ms -12.3%
SimpleFloatArithmetic: 90ms 98ms -8.1% 92ms 101ms -8.3%
SimpleIntFloatArithmetic: 64ms 78ms -17.2% 65ms 79ms -18.0%
SimpleIntegerArithmetic: 60ms 78ms -23.3% 60ms 79ms -24.3%
SimpleListManipulation: 71ms 85ms -16.3% 73ms 87ms -16.3%
SimpleLongArithmetic: 103ms 114ms -9.8% 106ms 116ms -8.1%
SmallLists: 121ms 128ms -5.5% 122ms 131ms -6.9%
SmallTuples: 107ms 114ms -6.2% 109ms 116ms -6.0%
SpecialClassAttribute: 100ms 110ms -9.7% 102ms 111ms -7.8%
SpecialInstanceAttribute: 175ms 182ms -3.7% 178ms 184ms -3.5%
StringMappings: 172ms 177ms -2.8% 175ms 178ms -1.6%
StringPredicates: 147ms 146ms +0.7% 149ms 147ms +1.0%
StringSlicing: 112ms 112ms +0.2% 116ms 120ms -3.5%
TryExcept: 55ms 77ms -28.3% 56ms 78ms -27.7%
TryRaiseExcept: 105ms 104ms +1.2% 106ms 105ms +1.0%
TupleSlicing: 110ms 107ms +3.2% 113ms 112ms +0.7%
UnicodeMappings: 106ms 108ms -1.5% 108ms 109ms -1.6%
UnicodePredicates: 106ms 113ms -5.4% 109ms 115ms -5.6%
UnicodeProperties: 102ms 113ms -9.7% 104ms 116ms -10.2%
UnicodeSlicing: 93ms 98ms -5.1% 95ms 102ms -7.1%
-------------------------------------------------------------------------------
Totals: 5106ms 5645ms -9.5% 5221ms 5985ms -12.8%
(this=py25t.pybench, other=py25.pybench)
this == your threaded VM, other == the 2.5.3a0 VM.
Skip
More information about the Python-Dev
mailing list