Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation time improvements (part 1) #2581

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Compilation time improvements (part 1) #2581

wants to merge 8 commits into from

Conversation

ammen99
Copy link
Member

@ammen99 ammen99 commented Feb 18, 2025

Part 1 of my changes aimed at improving compilation times in Wayfire.
The changes here are pretty straightforward, just shuffling header files and definitions around so that we don't include stuff we don't need.

There are no breaking changes for plugins, but some plugins may be broken if they rely on transitive includes.

Breaking changes for plugins:

  • wf::get_core().config is now a pointer.
  • Output signals are defined in output-layout.hpp instead of signal-definitions.hpp
  • keyboard-focus-changed and seat-activity signals are defined in seat.hpp

If plugins use these signals, they ought to now include the correct headers.

Benchmark on my 6C12T laptop shows 52s build time before, 46s build time after, so about 12% faster.

@soreau
Copy link
Member

soreau commented Feb 18, 2025

Here on Intel(R) Core(TM) i5-2500K CPU @ 3.30GHz, ctimes-v2 branch is slightly slower than current master. These are the commands I ran and the results:

git checkout master && git pull
ccache -C
rm -rf build
meson setup -Duse_system_wlroots=enabled -Duse_system_wfconfig=enabled build && time ninja -C build
...
[482/482] Linking target plugins/ipc-rules/libipc-rules.so

real	2m53.061s
user	6m51.206s
sys	0m48.135s

git checkout ctime-v2
ccache -C
rm -rf build
meson setup -Duse_system_wlroots=enabled -Duse_system_wfconfig=enabled build && time ninja -C build
...
[482/482] Linking target plugins/ipc-rules/libipc-rules.so

real	2m58.031s
user	6m2.048s
sys	0m44.082s

@ammen99
Copy link
Member Author

ammen99 commented Feb 18, 2025

Huh weird, maybe I need to test gcc too instead of just clang. In any case, try adding pch, maybe that will tilt the timing in favor of the changes? -Db_pch=true to meson

@soreau
Copy link
Member

soreau commented Feb 18, 2025

Huh weird, maybe I need to test gcc too instead of just clang. In any case, try adding pch, maybe that will tilt the timing in favor of the changes? -Db_pch=true to meson

According to the meson docs, b_pch defaults to true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants