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"

Reply via email to