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

[FR]: Remove public #include <iomanip> include directives for build speed #4329

Closed
IncludeGuardian opened this issue Aug 3, 2023 · 2 comments
Assignees
Labels
enhancement priority: p2 Moderately important; Fix may not be in the next release.

Comments

@IncludeGuardian
Copy link

Does the feature exist in the most recent commit?

No.

Why do we need this feature?

As <iomanip> is not a common included file, its content is unlikely to be included in translation units other than through GoogleTest includes.

By reducing the number of include directives public headers in GoogleTest, this may reduce the time taken to compile tests as it would reduce the amount of work that the preprocessor and compiler front-end need to do.

The C++ Compile Health Watchdog puts <iomanip> at ~100ms-200ms extra compilation cost.

~0.45% of all preprocessing tokens in translation units in LLVM come from this <iomanip> include directive in GoogleTest. https://gist.github.com/IncludeGuardian/7e560c26783d5f11d7645c96db6b81d4#file-after-yaml-L4066-L4069

Describe the proposal.

Move the includes of <iomanip> in public headers:

and call the precision method instead of using std::setprecision.

Is the feature specific to an operating system, compiler, or build system version?

No.

@IncludeGuardian
Copy link
Author

Initial PR: #4330

@derekmauro derekmauro self-assigned this Aug 7, 2023
@derekmauro derekmauro added the priority: p2 Moderately important; Fix may not be in the next release. label Aug 7, 2023
@IncludeGuardian
Copy link
Author

#4330

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement priority: p2 Moderately important; Fix may not be in the next release.
Projects
None yet
Development

No branches or pull requests

2 participants