Skip to content

Conversation

@jmarrec
Copy link
Contributor

@jmarrec jmarrec commented Feb 3, 2025

Pull request overview

Original idea is from @lefticus (thanks!)

I built develop, and this branch.

Then I randomly sampled 300 CTests (about 10%, 2905 total).

I ran these ctests 10 times in a row, with -j 1, in order to get more stable timings, so I could take the mean of the 10 runs for each.

Globally, I arrive at a 5% runtime improvement on Ubuntu 24.04, but that may be skewed by some outliers.
Taken another way, if I calculate a runtime improvement % on a test by test basis, then take the mean of that, I arrive at a 3.1% improvement.

Binary size:

  • Ubuntu: 47MB with this branch versus 51MB on develop, a 7% reduction
    • nm -C -D Products/libenergyplusapi.so.25.1.0 gives 32385 lines in develop, 2435 on this branch.
  • Not noticable on macOS

My analysis notebook can be found here: https://gist.github.com/jmarrec/a3388c8898bad65894faebb90c38fba6

Pull Request Author

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • 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
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jmarrec jmarrec added Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels Feb 3, 2025
@github-actions
Copy link

github-actions bot commented Feb 3, 2025

⚠️ Regressions detected on macos-14 for commit e47d8ec

Regression Summary

@github-actions
Copy link

github-actions bot commented Feb 3, 2025

⚠️ Regressions detected on macos-14 for commit 5cd1424

Regression Summary

@Myoldmopar
Copy link
Member

Well, the silly regression failures were unrelated to us. BeautifulSoup4 had a release 6 hours ago which broke things...

image

I could reproduce the problem if I installed the latest BS4 version. I pinned back to the previous version and it's happy. I'm verifying on the regression tool codebase and will pin E+ to the latest version of that once I make a release there.

I really thought this was a "me" problem after the regression changes last week....what a coincidence!

@jmarrec jmarrec self-assigned this Feb 4, 2025
@jmarrec jmarrec requested a review from Myoldmopar February 4, 2025 14:28
@jmarrec
Copy link
Contributor Author

jmarrec commented Feb 4, 2025

@Myoldmopar I updated the original post with some timings and a notebook

@jmarrec jmarrec marked this pull request as ready for review February 4, 2025 14:29
@Myoldmopar
Copy link
Member

Thanks @jmarrec, looks like it turned out all clean now. I'll do a quick triple check with develop but expect this to merge in a few minutes.

Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

Yep, all good here! And I tested locally and it's happy too. Merging this, thanks @jmarrec

- name: Install Regression Tool
if: always() && matrix.run_regressions && steps.branch_build.outcome != 'failure' # always run this step as long as we actually built
run: pip install energyplus-regressions>=2.1.0
run: pip install energyplus-regressions>=2.1.1 # could rely on the requirements.txt file maybe
Copy link
Member

Choose a reason for hiding this comment

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

I added this line to get the updated regression tool, and thus the updated beautifulsoup4 dependency, so that regressions would actually ... work.


# requirements for the CI regression testing scripts
energyplus-regressions
energyplus-regressions>=2.1.1
Copy link
Member

Choose a reason for hiding this comment

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

I'm actually thinking I don't want this in here long term. The regression workflow can install this. No need for it when packaging.

if not backtrace_shown:
print("Traceback shown once:")
print_exc()
backtrace_shown = True
Copy link
Member

Choose a reason for hiding this comment

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

When the regression script has an exception, this will print a traceback which will save me multiple hours of trying to debug and reproduce just to get the call stack of the error. And it only shows it one time to avoid bloating the output even more.

set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
Copy link
Member

Choose a reason for hiding this comment

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

👍

@Myoldmopar
Copy link
Member

And thanks for the tip, @lefticus !!

@Myoldmopar Myoldmopar merged commit df37542 into develop Feb 4, 2025
9 checks passed
@Myoldmopar Myoldmopar deleted the fvisibility branch February 4, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) Performance Includes code changes that are directed at improving the runtime performance of EnergyPlus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate using fvisibility=hidden to reduce binary size and provide performance benefits

5 participants