Compiling python extensions: Borlands free compiler versus gcc
Anton Vredegoor
anton at vredegoor.doge.nl
Wed May 9 04:12:16 EDT 2001
Hello All,
Some time ago I compiled a c extension for python under microsoft
windows with borlands free c compiler and also compiled the same
extension with gcc in order to compare the execution speed and size of
the resulting dll's. In some aspects the resulting extension was
faster if compiled with BCC and in other aspects the gcc compiled
extension was faster. I noticed one curious thing though: the BCC dll
was a lot bigger than the gcc dll. After inspecting it I found some
strange code fragments inside it, which were some parts of a
python(?!) file I had been editing earlier. It seemed to me the BCC
compiler creates an unnecessarily big dll and what is worse it doesn't
erase the parts of the harddisk its using for the extra size? Since
that time I am mainly using gcc for things I post to the net :-|.
Maybe its some compiler switch I missed or some misconfiguration of
mine. Can anyone comment on this? Anyway I am happy to have a choice
of free compilers so I am not complaining about either one!
Anton.
extension: cnrg.c <http://www.sbc.su.se/~per/crng/index.html>
Borland:
Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.6 -- press F1 for help
>>>
ParkMiller() : 4.26 10^6 iters/sec ( 0.235)
WichmannHill() : 2.29 10^6 iters/sec ( 0.437)
LEcuyer() : 3.33 10^6 iters/sec ( 0.300)
Ranlux(0) : 7.48 10^6 iters/sec ( 0.134)
Ranlux(1) : 4.50 10^6 iters/sec ( 0.222)
Ranlux(2) : 2.71 10^6 iters/sec ( 0.369)
Ranlux(3) : 1.39 10^6 iters/sec ( 0.718)
Ranlux(4) : 0.87 10^6 iters/sec ( 1.146)
Taus88() : 7.78 10^6 iters/sec ( 0.128)
MRG32k3a() : 1.21 10^6 iters/sec ( 0.828)
MT19937() : 5.54 10^6 iters/sec ( 0.181)
mingw gcc:
Python 2.0 (#8, Oct 16 2000, 17:27:58) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
IDLE 0.6 -- press F1 for help
>>>
ParkMiller() : 5.35 10^6 iters/sec ( 0.187)
WichmannHill() : 1.08 10^6 iters/sec ( 0.926)
LEcuyer() : 3.01 10^6 iters/sec ( 0.332)
Ranlux(0) : 6.16 10^6 iters/sec ( 0.162)
Ranlux(1) : 4.33 10^6 iters/sec ( 0.231)
Ranlux(2) : 2.72 10^6 iters/sec ( 0.367)
Ranlux(3) : 1.39 10^6 iters/sec ( 0.719)
Ranlux(4) : 0.85 10^6 iters/sec ( 1.180)
Taus88() : 8.23 10^6 iters/sec ( 0.121)
MRG32k3a() : 1.98 10^6 iters/sec ( 0.506)
MT19937() : 4.21 10^6 iters/sec ( 0.237)
More information about the Python-list
mailing list