NatLabRockies / NatLabRockies/OpenStudio

[Performance] Avoid doing more work than needed in ForwardTranslator

Open
#4,704 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

component - Version Translator Performance severity - Normal Bug
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

Open the contributing guide

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.

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.