since there are already higly optimized parts with "-O3 -fPIC
-funswitch-loops -minline-all-stringops -fno-strict-aliasing -flto
-ffat-lto-objects -fuse-ld=gold -fuse-linker-plugin" even if you biuld
with -Os (which is a good combination when performance critical code is
optimized while the rest not bloated) i guess that parts could be
enhanced by the implicit "-funroll-loops"
as httpd typically has similar operations for every website it could be
easier to profile than PHP where you really need to profile your
application
PGO enables the options below and our PHP build with PGO is 0.8 MB
smaller (the main binary while anything is built as loadable extension)
than without while gives around 7-10% performance gain and the
profiling-code running through a complete website in a loop should be
re-usable for httpd too
______________________________________
-fprofile-use=
Enable profile feedback-directed optimizations, and the following
optimizations which are generally profitable only with profile feedback
available: -fbranch-probabilities, -fvpt, -funroll-loops, -fpeel-loops,
-ftracer, -ftree-vectorize, and ftree-loop-distribute-patterns.
Before you can use this option, you must first generate profiling
information. See Optimize Options, for information about the
-fprofile-generate option.
Am 11.10.2016 um 13:32 schrieb Reindl Harald:
https://en.wikipedia.org/wiki/Profile-guided_optimization
for PHP it's easy because the makefiles support it directly
make %{?_smp_mflags} prof-gen
/usr/bin/bash /rpmbuild/PHP-PGO/profile.sh --php_build $PWD
make prof-clean
make %{?_smp_mflags} prof-use
_________________________________________________
i tried to replicate that for httpd but obviously CFLAGS after
./configure are completly ignored but you need "-fprofile-generate" for
the first make and "-fprofile-generate" after benchmark the application
for the second build which means that the stuff belows looks not
terrible wrong but don't work at all
export CFLAGS="$COMPILERFLAGS -fprofile-generate"
export CXXFLAGS="$COMPILERFLAGS -fprofile-generate"
CCACHE_DISABLE=1 make %{?_smp_mflags} PROF_FLAGS="-fprofile-generate all"
/usr/bin/bash /rpmbuild/PHP-PGO/profile.sh --httpd_build $PWD
find . -name \*.lo -o -name \*.o | xargs rm -f
find . -name \*.la -o -name \*.a | xargs rm -f
find . -name \*.so | xargs rm -f
rm -f httpd libs/*
export CFLAGS="$COMPILERFLAGS -fprofile-use"
export CXXFLAGS="$COMPILERFLAGS -fprofile-use"
CCACHE_DISABLE=1 make %{?_smp_mflags} PROF_FLAGS="-fprofile-use all"