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

Fix #4331 - Fix StringHelpers openstudio::replace #4332

Merged
merged 4 commits into from
Jun 1, 2021
Merged

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented May 27, 2021

Pull request overview

Fix #4331 - Fix StringHelpers openstudio::replace

( Fix openstudiocoalition/OpenStudioApplication#332 as well )

I replaced it with boost::replace_all (which in this case acts exactly like boost::replace_all_copy since we take input by value (copy)), since it's considerably faster on larger strings (which is our case since we mostly use it for replacing inside ruby file contents), cf benchmark I wrote on my repo here: jmarrec/CppBenchmarks@c91dbd9

bench_replace_string

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

jmarrec added 2 commits May 27, 2021 12:20
```
$ ctest -R String.replace
Test project /home/julien/Software/Others/OS-build-release
    Start 251: String.replace
1/1 Test #251: String.replace ...................***Timeout  10.01 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =  10.31 sec

The following tests FAILED:
	251 - String.replace (Timeout)
Errors while running CTest
Output from these tests are in: /home/julien/Software/Others/OS-build-release/Testing/Temporary/LastTest.log
Use "--rerun-failed --output-on-failure" to re-run the failed cases verbosely.

```
@jmarrec jmarrec self-assigned this May 27, 2021
jmarrec added a commit to jmarrec/CppBenchmarks that referenced this pull request May 27, 2021
@jmarrec jmarrec added the Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. label May 27, 2021
@tijcolem
Copy link
Collaborator

tijcolem commented Jun 1, 2021

Looks good to me. Any performance gain such as this is welcome. I did a sanity test and ran the regression test suite as well (https://github.com/NREL/OpenStudio-resources/runs/2697133178?check_suite_focus=true) and all checked out good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Utilities Other Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. severity - Normal Bug
Projects
None yet
3 participants