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

Reduce compile time #6

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

Halbaroth
Copy link
Collaborator

This PR reduces the huge compile time by a factor of two. I caught the
guilty template using the profiler features of clang++. Basically,
configure the project with

CXX=/usr/bin/clang++ CXXFLAGS="-ftime-trace" ./configure

will activate the profiler and clang++ produces a json file per
compilation unit. The compiler instantiates massively the template spdlog::pattern_formatter::handle_flag_ from the spdlog library. It is a well known issue (see for instance the issue gabime/spdlog#1708). The solution consists in using the compiled version of the library with the flag -DSPDLOG_COMPILED_LIB.

Before this commit, the compile time for the complete project was around
3m30s on my laptop. After this commit, it is 1m50s.

The size of the runtime is 69M.

@Halbaroth Halbaroth force-pushed the reduce-compile-time branch from 83058fd to a181e25 Compare October 15, 2024 11:36
@Halbaroth Halbaroth merged commit 95c5ddc into OCamlPro:main Oct 15, 2024
This PR reduces the huge compile time by a factor of two. I caught the
guilty template using the profiler features of `clang++`. Basically,
configure the project with

```
CXX=/usr/bin/clang++ CXXFLAGS="-ftime-trace" ./configure
```
will activate the profiler and `clang++` produces a json file per
compilation unit. The compiler instantiates massively the template `spdlog::pattern_formatter::handle_flag_` from the spdlog library. It is a well known issue (see for instance the issue gabime/spdlog#1708). The solution consists in using the compiled version of the library with the flag `-DSPDLOG_COMPILED_LIB`.

Before this commit, the compile time for the complete project was around
3m30s on my laptop. After this commit, it is 1m50s.

The size of the runtime is 69M.
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