Le Monday 03 November 2008 18:56:37 Paul Miller, vous avez écrit :
> Rather than that, what about patching Python's long implementation 
> to use GMP if it's available, and the default implementation if not?

Yes, I like this suggestion of two flavors. Python with GMP and Python without 
GMP (builtin integer library). It's "easy" to change the long type 
implementation since only few modules use PyLong internals:
 - mashal: import/export (.pyc)
   => core function might be moved to longobject.c
 - math: use some special features of the PyLong type
   => macro can be written for that
or simplify a #ifdef.

I first wrote a patch in January 2008 to test Python3 + GMP. After your email 
I updated my patch and fix it to pass most regression tests. Depending of the 
patch version, the overhead (of using GMP instead a builtin library) is 
between 14% and 3% (Python is slower with GMP). I used pystone which is not a 
math application.

More details at:
http://bugs.python.org/issue1814

-- 
Victor Stinner aka haypo
http://www.haypocalc.com/blog/
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to