Re: Pyrex speed

2006-05-28 Thread [EMAIL PROTECTED]
The stuff you do are not representative of 100% of programming conducted in the world. Not even 90% and probably not even 50% of programming work is similar to what you do. The fact you never use sophisticated math doesn't mean this guy doesn't either. Personally, I've used pyrex a lot. And it was

Re: Pyrex speed

2006-05-27 Thread Gonzalo Monzón
Hi John, John Machin escribió: >On 28/05/2006 12:10 AM, Gonzalo Monzón wrote: > >[good advice snipped] > > > >>Example A: >>This code is more than 80 times faster than a "easy" Python >>implementation. For every call, it does some bitwise operations and does >>an array lookup for every string

Re: Pyrex speed

2006-05-27 Thread John Machin
On 28/05/2006 12:10 AM, Gonzalo Monzón wrote: [good advice snipped] > > Example A: > This code is more than 80 times faster than a "easy" Python > implementation. For every call, it does some bitwise operations and does > an array lookup for every string character from argument. Its a lot > f

Re: Pyrex speed

2006-05-27 Thread Gonzalo Monzón
Hi Jim, It depends a lot on what you're doing. You will get speed up from Pyrex or wrapping C code if you understand how does it work internally, and to speed up you application via coding *only* Pyrex parts (I mean don't using it for wrapping C but implementing in Pyrex), it limits a lot the

Re: Pyrex speed

2006-05-27 Thread Graham Breed
Jim Lewis \/\/|20+3: > I'm not planning to write C functions. My understanding is that by > using cdefs in the python code one can gain substantial speed. I'm > trying to find a description of how to modify python code in more > detail so it runs fast under pyrex. I've used pyrex to speed up my co

Re: Pyrex speed

2006-05-27 Thread Jim Lewis
> I never had an opportunity to do any more sophisticated math than simple > adding, multiplying, subtracting and dividing. Neither is the primes example doing anything more sophisticated than basic arithmetic but it's 50 times faster. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex speed

2006-05-27 Thread Jarek Zgoda
Jim Lewis napisal: >>main point of Pyrex is ease of wrapping, not of speeding-up. > > Supposedly the primes example is 50 times faster. How often you perform primes calculations in your programs? In my >10 years of professional career in writing business software I never had an opportunity to do

Re: Pyrex speed

2006-05-27 Thread Jim Lewis
> main point of Pyrex is ease of wrapping, not of speeding-up. Supposedly the primes example is 50 times faster. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex speed

2006-05-27 Thread Simon Percivall
You can gain substantial speed-ups in very certain cases, but the main point of Pyrex is ease of wrapping, not of speeding-up. Depending on what you're doing, rewriting in Pyrex or even in C, using the Python/C API directly, might not gain you much. -- http://mail.python.org/mailman/listinfo/pyt

Re: Pyrex speed

2006-05-27 Thread Jim Lewis
I'm not planning to write C functions. My understanding is that by using cdefs in the python code one can gain substantial speed. I'm trying to find a description of how to modify python code in more detail so it runs fast under pyrex. -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex speed

2006-05-27 Thread Diez B. Roggisch
Jim Lewis schrieb: > Has anyone found a good link on exactly how to speed up code using > pyrex? I found various info but the focus is usually not on code > speedup. The code speedup comes through the usage of C by pyrex itself, and using it to put a thin layer over C-functions available/coded fo

Pyrex speed

2006-05-27 Thread Jim Lewis
Has anyone found a good link on exactly how to speed up code using pyrex? I found various info but the focus is usually not on code speedup. -- http://mail.python.org/mailman/listinfo/python-list