Skip to content

Comments

compilation times improvement#2455

Closed
ammen99 wants to merge 12 commits intomasterfrom
compilation-times-improvement
Closed

compilation times improvement#2455
ammen99 wants to merge 12 commits intomasterfrom
compilation-times-improvement

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)

@ammen99
Copy link
Member Author

ammen99 commented Mar 25, 2025

Closing this in favor of #2581 #2591 #2592 #2604

@ammen99 ammen99 closed this Mar 25, 2025
@ammen99 ammen99 deleted the compilation-times-improvement branch May 30, 2025 19:24
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