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 build time by suppressing template instantiation #1419

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

shouth
Copy link
Contributor

@shouth shouth commented Oct 10, 2024

Description

Abstract

This PR reduces the build time of openscenario_interpreter by suppressing heavy template instantiation.

Background

openscenario_interpreter heavily relies on templated components. These components are typically instantiated and optimized per translation unit, which can lead to longer build times.

Details

Added several explicit instantiations to readAttribute and moved the substitute() function used internally to the cpp file. No changes were made to the algorithm itself.

Added several explicit instantiations to readElement. Additionally, the choice() function was made non-template and its implementation was moved to the cpp file. No changes were made to the algorithm itself. Due to this change, the arguments of the choice() function have changed from "variadic arguments of std::pair" to "std::unordered_map," resulting in a slight modification in how the arguments are described in the places where choice() is called. Most of the changes in the diffs are due to this modification.

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.

@shouth shouth self-assigned this Oct 10, 2024
@shouth shouth added bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 wait for regression test labels Oct 10, 2024
Copy link

@shouth shouth marked this pull request as ready for review October 24, 2024 07:00
@yamacir-kit yamacir-kit self-requested a review October 24, 2024 07:02
shouth and others added 7 commits March 6, 2025 09:34
Co-authored-by: Tatsuya Yamasaki <httperror@404-notfound.jp>
Co-authored-by: Tatsuya Yamasaki <httperror@404-notfound.jp>
Co-authored-by: Tatsuya Yamasaki <httperror@404-notfound.jp>
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 wait for regression test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants