Ticket #13335 (closed enhancement: fixed)
python25 is compiled without optimization, 2x slower on mac os 10.5, others?
| Reported by: | bulk@… | Owned by: | mww@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | Port Enhancements |
| Component: | ports | Version: | 1.5.2 |
| Keywords: | Python python25 | Cc: | |
| Port: |
Description
Hiya,
while installing python2.5 on my system, I happened to notice that I didn't see the usual "-O2" option while gcc was compiling files. THen I had a small benchmark program, and yes, it runs 2x slower than 10.5 /usr/bin/python on Mac OS 10.5.1
DEBUG: Environment: CXXFLAGS='-O2' CPPFLAGS='-I/opt/local/include' CFLAGS='-O2'
but...
gcc -c -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -DNDEBUG -DDARWIN_UNIX03 -I. -I./Include -I/opt/local/include -DPy_BUILD_CORE -o Parser/parser.o Parser/parser.c (to use one example)
I looked into the portfile
platform darwin 9 {
configure.post_args-append OPT="-DDARWIN_UNIX03"
}
I think this may be clobbering the CFLAGS def. I added
platform darwin 9 {
configure.post_args-append OPT="-O3 -DDARWIN_UNIX03"
}
and it compiles correctly (but I need to remove and then install everything). I'm pretty sure there must be a way of reading $CFLAGS from the env, but I don't know enough about TCL (I tried $::env(CFLAGS), nope) or MacPorts to know.
WIth -O3, macports python runs about 10% faster than the Mac 10.5.1 python
thanks.
--nickg

