NatLabRockies / NatLabRockies/OpenStudio
[Performance] Avoid doing more work than needed in ForwardTranslator
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 646
- Forks
- 237
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 10
Description
Issue overview
While working on https://github.com/NREL/OpenStudio/pull/4700 I realized that my ZoneMixing object goes FOUR times though the translateZoneMixing in the case the translateZoneMixing returns boost::none. This is mostly because it's added to the list of iddObjectsToTranslate and because of that
https://github.com/NREL/OpenStudio/blob/develop/src/energyplus/ForwardTranslator.cpp#L3247-L3262
Current Behavior
We try to translate my object four times
Expected Behavior
Once is enough!
Possible Solution
Clean up the iddObjectsToTranslate, and probably eliminate that old block of code. Do that after the release though, we can't risk breaking stuff now.
Details
Environment
Some additional details about your environment for this issue (if relevant):
- Platform (Operating system, version): all
- Version of OpenStudio (if using an intermediate build, include SHA): 3.5.0-alpha
Context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading src/energyplus/ForwardTranslator.cpp around lines 3247-3262 and trace how iddObjectsToTranslate handles a ZoneMixing translation that returns boost::none. Confirm why the object is revisited four times, then make the translation path process it once while preserving existing behavior. The issue is done when the repeated translation no longer occurs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100