shinchiro/mpv-winbuild-cmake

enable thinlto for packages will increase the first time compile time

Closed this issue · 8 comments

Enable thinlto for packages will increase the x86_64(not x86_64-v3) compile time.
The comparison is very obvious, especially when compiling ffmpeg and mpv.

enable thinlto for all packages, took about 44min(https://github.com/eko5624/mpv-winbuild/actions/runs/7676626171)
disable thinlto for all packages, took about 24min(https://github.com/eko5624/mpv-winbuild/actions/runs/7677718754)

Yes, it's normal.

Then the CI should switch to default CLANG_PACKAGES_LTO="OFF" for x86_64 compilation.

Thanks. I will try to add ThinLTO cache to see if the problem can be resolved.

So I consider to drop ccache, just only packages thinlto.

Fortunately, only shaderc and ffmpeg link dll/exe, so you can consider merge shaderc/libplacebo/ffmpeg into the same runner.

what confuse me is where is the thinlto directory when shaderc compiled done. Do you mean only ffmpeg has thinlto things? If so, I only need to cache thinlto dir when ffmpeg compiled done.

So I should set --thinlto-cache-dir to where?
By the way, in archlinux docker, when input cd ~, the output is /github/home

Thanks for your tip, I will try it.

It works now since https://github.com/eko5624/mpv-winbuild/tree/e3ff1d33014ac0379ad17b792a243d576ce1bd9c
But It seems the compilation speed is no difference between enable thinlto and disable thinlto. And I find when enable thinlto, the size of mpv.exe is slightly larger than disable thinlto.