koenkooi / meta-kodi

The official OpenEmbedded/Yocto Project layer for Kodi
11 stars 27 forks source link

BUILD_OPTIMIZATION (FULL_OPTIMIZATION_armv7a) #46

Closed andrea-adami closed 2 years ago

andrea-adami commented 2 years ago

Hi,

I did some tests planning to add FULL_OPTIMIZATION_armv7ve = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math"

These 'optimizations' were adding the following: CFLAGS=" -fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math -march=armv7ve -mfpu=neon-vfpv4 -mfloat-abi=hard --sysroot=..." kodi-stb is 18566k Note how -march -mfpu -mfloat are wrongly repeated here (these are in $CC)

Removing the line we have the (Distro-) standard: CFLAGS=" -Os -pipe -g -feliminate-unused-debug-types -fmacro-prefix-map...." kodi-stb is 18574k

Note that the gcc manual says Os implies almost the same O2 optimizations thus -fexpensive-optimizations is included.

So instead of adding armv7ve and cortexa15 (the 'generic' defaulttune) I'd say we can remove both lines:

FULL_OPTIMIZATION_armv7a = "-fexpensive-optimizations -fomit-frame-pointer -O4 -ffast-math" BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"

Kodi itself is just a container, we must optimize ffmpeg instead.

My 2 cents A.A.

dev-0x7C6 commented 2 years ago

I was wondering to remove them a while ago, are you suggesting to modify ffmpeg using additional bbappend? Did you tried LTO'ing kodi/ffmpeg?

Maybe we should just drop any adjustments unless there is some proof we can gain more that 0.1% of performance.

andrea-adami commented 2 years ago

I have done only compile tests but have not run any benchmark on armv7a/armv7ve/cortexa15.

I see the STB distros like OpenPLi and OE-A are carrying these old lines but I still think this does not add much and should be removed from here. The Distro will decide the package-level optimizations if any.

For some reasons OE-A does strange tricks with ffmpeg used together with kodi. See pls. here:

https://github.com/oe-alliance/oe-alliance-core/blob/5.0/meta-oe/recipes-mediacenter/kodi/stb-kodi_19.bb#L195 and https://github.com/oe-alliance/oe-alliance-core/blob/5.0/meta-oe/recipes-mediacenter/kodi/stb-kodi-19/0006-stb-settings-19.patch#L19

Same reasoning here: up to the Distro to decide.

dev-0x7C6 commented 2 years ago

Thanks for expertise, I removed those optimizations.