atom feed30 messages in org.python.python-dev[Python-Dev] Optimization targets
FromSent OnAttachments
Raymond HettingerApr 13, 2004 8:00 pm 
Jeff EplerApr 13, 2004 9:10 pm 
Bob IppolitoApr 13, 2004 9:26 pm 
Jeff EplerApr 13, 2004 10:04 pm 
Raymond HettingerApr 13, 2004 10:17 pm 
Jeff EplerApr 13, 2004 11:10 pm 
Guido van RossumApr 13, 2004 11:26 pm 
Tim PetersApr 13, 2004 11:56 pm 
Jeff EplerApr 14, 2004 9:08 am 
Raymond HettingerApr 14, 2004 12:06 pm 
Andrew MacIntyreApr 14, 2004 3:23 pm 
Jeff EplerApr 14, 2004 3:35 pm 
Mike PallApr 14, 2004 5:50 pm 
Tim PetersApr 14, 2004 11:14 pm 
Michael HudsonApr 15, 2004 7:05 am 
Mike PallApr 15, 2004 9:36 am 
Guido van RossumApr 15, 2004 10:27 am 
Jeremy HyltonApr 15, 2004 10:38 am 
Guido van RossumApr 15, 2004 10:42 am 
Mike PallApr 15, 2004 11:56 am 
Mike PallApr 15, 2004 11:56 am 
Skip MontanaroApr 15, 2004 11:59 am 
Michael HudsonApr 15, 2004 1:27 pm 
Raymond HettingerApr 15, 2004 2:22 pm 
Thomas HellerApr 15, 2004 2:31 pm 
"Martin v. Löwis"Apr 15, 2004 3:07 pm 
Jeremy HyltonApr 15, 2004 11:26 pm 
Tim PetersApr 16, 2004 12:18 am 
"Martin v. Löwis"Apr 16, 2004 2:00 am 
Andrew MacIntyreApr 16, 2004 9:14 pm 
Subject:[Python-Dev] Optimization targets
From:"Martin v. Löwis" (mar@v.loewis.de)
Date:Apr 15, 2004 3:07:30 pm
List:org.python.python-dev

Jeremy Hylton wrote:

Another question that I'd love to hear the answer to: What's the difference between Pysco and something like this Self implementation or the HotSpot Java implementation?

Psyco is specializing, and that is the main difference compared to Java Hotspot. If you have a program

def f(a, b): if a>b: return a else: return a-b

f(1,2) f(1.0, 2.0) f([1,2],[3,4])

then psyco generates machine code for *three* functions

int f_int(int a, int b){ // uses process int arithmethic throughout if(a>b)return a; else return a-b; }

double f_double(double a, double b){ // uses FPU ops throughout if(a>b)return a; else return a-b; }

list f_list(list a, list b){ // might invoke C functions if(list_gt(a, b))return a; else raise TypeError("unexpected operands"); }

(it actually generates different specializations)

In Hotspot, the type of f would already be defined in the Java source code, and Hotspot generates native machine instructions for it.

The changes over standard JIT appear to be inlining; it also appears to do inlining of virtual functions, combined with a type check to detect cases where the a different functions should have been called compared to the last time the virtual call was made.

Regards, Martin