Massive compilation time degradation when upgrading to libBoost 1.68

Open
#76 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
42/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
performance

Research direction

Start with commit 71d797b9ee132b381c2d4f3b5bcca2078b0a5062, which added flat_map() and its tests, then inspect the flat_map and map methods in the optional implementation. Reproduce the single-file compilation comparison with GCC 6.4 or GCC 8 and measure the effect of each method. Done means compilation returns near the pre-1.68 time without breaking Boost.Optional behavior.

Written by the indexing model from the issue text.

Description

After upgrading to libBoost 1.68 our compilation time of our project (3.1 m lines) deceased dramatically from ~45 min to ~1h 10min.

Deeper investigation points to this commit:

commit 71d797b9ee132b381c2d4f3b5bcca2078b0a5062
Author: Andrzej Krzemienski <akrzemi1@gmail.com>
Date:   Thu Jun 28 23:27:42 2018 +0200

    added implementation and tests of flat_map()

Compilation time of single file changes from 0m35.891s to 1m29.625s.
Same file compiled under other versions:

1.72:  1m28.077s
1.69:  1m26.839s
1.68:  1m30.255s
1.67:  0m26.357s
1.66:  0m26.683s

Our project heavily utilize boost::optional.
Tested on GCC 6.4 and GCC 8.

Commenting out "flat_map" methods reduces compilation time from 1m31.631s to 0m35.455s, commenting out additionally "map" method reduces compilation time even more back to 1.67 level (0m27.002s).

Please optimize these functions or add ability to exclude them from compilation.

Dominant language
C++
Stars
60
Forks
75
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/optional

All issues in boostorg/optional

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.