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

Speed up Nix compilation #4045

Open
2 of 3 tasks
edolstra opened this issue Sep 21, 2020 · 4 comments
Open
2 of 3 tasks

Speed up Nix compilation #4045

edolstra opened this issue Sep 21, 2020 · 4 comments

Comments

@edolstra
Copy link
Member

edolstra commented Sep 21, 2020

Nix compilation is getting quite slow. Maybe we can speed it up with some header discipline. Some offenders:

  • #include <regex> adds about 0.4s per compilation unit.
  • #include <nlohmann/json.hpp> adds about 0.7s per compilation unit.
  • The 2 boost headers included in fmt.hh (<boost/format.hpp> and <boost/algorithm/string/replace.hpp>) add about 0.7s to every compilation unit. Not easy to get rid of, but maybe we can switch to C++20's std::format or https://github.com/fmtlib/fmt.
edolstra added a commit that referenced this issue Sep 21, 2020
This reduces compilation time by ~15 seconds (CPU time).

Issue #4045.
edolstra added a commit that referenced this issue Sep 21, 2020
This gets rid of the inclusion of <future> in util.hh, cutting
compilation time by ~20s (CPU time).

Issue #4045.
edolstra added a commit that referenced this issue Sep 21, 2020
This reduces compilation time by 207s.

Issue #4045.
edolstra added a commit that referenced this issue Sep 21, 2020
This cuts compilation time by ~49s.

Issue #4045.
@Ericson2314
Copy link
Member

What happened to that branch where you were experimenting with recursive nix? :D

@stale
Copy link

stale bot commented Mar 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Mar 21, 2021
@stale
Copy link

stale bot commented Apr 19, 2022

I closed this issue due to inactivity. → More info

@stale stale bot closed this as completed Apr 19, 2022
@thufschmitt thufschmitt reopened this Feb 24, 2023
@Ericson2314
Copy link
Member

@roberth has done some work on this. #7876 should also help.

Once the lower hanging fruit is done, #6316 or recursive Nix could do an even better job.

@stale stale bot removed the stale label Mar 1, 2023
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

No branches or pull requests

3 participants