Optimization level -O3 should be enabled, also at link time with LTO
Inspecting the CXXFLAGS
used for compilation, I noticed that the -O2
optimization level is overriding the preferred -O3
(see below). It would be better to compile with with -O3
.
Furthermore, I also noticed that -flto
is enabled for link time optimization, but the optimization level during link time is set to -O1
with "-Wl,-O1"
.
I think LTO is a good idea, but the link time optimization level should be set at -O3
, otherwise it defeats the purpose!
I also noticed that debugging symbols have been enabled with -g
. This is not a problem per se, but the symbol list gets kind of huge. One could consider removing -g
and stripping the binaries.
>>> from graph_tool.all import *
>>> show_config()
version: 2.80 (commit c3fb00a7, Sun Dec 1 12:15:47 2024 +0100)
gcc version: 14.2.1
compilation flags: -DBOOST_ALLOW_DEPRECATED_HEADERS -DNDEBUG -fopenmp -O3 -fvisibility=default -fvisibility-inlines-hidden -Wno-deprecated -Wall -Wextra -ftemplate-backtrace-limit=0 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -g -ffile-prefix-map=/build/python-graph-tool/src=/usr/src/debug/python-graph-tool -flto=auto -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now -Wl,-z,pack-relative-relocs -flto=auto
install prefix: /usr
python dir: /usr/lib/python3.13/site-packages
graph filtering: True
openmp: True
uname: Linux maelcum 6.12.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 19 Dec 2024 21:29:01 +0000 x86_64