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 times improvement #2455

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Conversation

ammen99
Copy link
Member

@ammen99 ammen99 commented Aug 27, 2024

This PR aims to improve compilation times of Wayfire's core and plugins.

A benchmark on my own laptop (which uses AMD Ryzen 5600U) with 6C12T:

  • Before: 1m1s, slowest file: scale.cpp which takes ~9s.
  • After: 24s, slowest file: tile-plugin.cpp which takes ~6s.

This is achieved through a combination of techniques:

  • Headers are shuffled around so that we include less header files overall.
  • We pre-declare a few very frequently used templates (option templates).
  • We split some of the header-only helpers (workspace-wall, move-drag-helper) to a separate cpp file and link the resulting library with the plugins that need it.
  • We use a custom PCH solution for plugins (manually generating it because meson is not smart enough yet, see Shared precompiled header mesonbuild/meson#4350)
  • We switch away from nlohmann/json and into jsoncpp (an unfortunate breaking change).

TODOs:

  • Benchmark the impact of jsoncpp vs nlohmann/json
  • Look into whether the plugin PCH cannot be easily solved on the meson side, upstream seems to not be against solving it properly, but I have no knowledge of meson's internals.
  • Clean up the [DONOTMERGE] commits.
  • Fix build order (wobbly vs plugins/common)

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.

1 participant