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

Reducing build time of openscenario_interpreter by utilizing precompiled headers #1370

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

shouth
Copy link
Contributor

@shouth shouth commented Sep 10, 2024

Description

Abstract

This pull request reduces the build time for opendscenario_interpreter by using precompiled headers.

Background

In the current codebase, large header files were being parsed multiple times and cause longer build time. To address this, I used Clang's -ftime-trace to identify the headers that were taking the most time to parse and updated CMakeLists.txt to ensure they are precompiled.

Details

In my environment, the build time of openscenario_interpreter was reduced from 9m 21s to 7m 59s with 12 parallel builds.

References

N/A

Destructive Changes

N/A

Known Limitations

N/A

Copy link

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@yamacir-kit yamacir-kit self-requested a review September 10, 2024 09:04
@shouth shouth added small feature improvement wait for regression test bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Sep 17, 2024
Comment on lines +39 to +49
"<nlohmann/json.hpp>"
"<rclcpp/rclcpp.hpp>"
"<traffic_simulator/api/api.hpp>"
"<pugixml.hpp>"

"<openscenario_interpreter/expression.hpp>"
"<openscenario_interpreter/object.hpp>"
"<openscenario_interpreter/pointer.hpp>"
"<openscenario_interpreter/record.hpp>"
"<openscenario_interpreter/scope.hpp>"
"<openscenario_interpreter/simulator_core.hpp>")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sort lexicographically, unless there is a technical reason why declaration order matters. Also, please remove blank lines.

@yamacir-kit
Copy link
Collaborator

I have confirmed that the openscenario_interpreter build is 3 minutes shorter in GitHub Actions as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 improvement small feature wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants