stellarium icon indicating copy to clipboard operation
stellarium copied to clipboard

Cache UTC offset

Open gzotti opened this issue 1 year ago • 4 comments

Finding UTC offset is surprisingly costly but is executed per-frame, shown in VTune. Caching the result per-minute saves at least part of it.

This needs some testing.

Description

Fixes # (issue)

Screenshots (if appropriate):

2024-09-16d getCommonInfoString_UTCoffset

With this caching: 2024-09-16e cachedUTCoffset

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] This change requires a documentation update
  • [ ] Housekeeping

How Has This Been Tested?

Test Configuration:

  • Operating system: Win11
  • Graphics Card: irrelevant

Checklist:

  • [x] My code follows the code style of this project.
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation (header file)
  • [ ] I have updated the respective chapter in the Stellarium User Guide
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes
  • [ ] Any dependent changes have been merged and published in downstream modules

gzotti avatar Sep 17 '24 09:09 gzotti

Great PR! Please pay attention to the following items before merging:

Files matching src/**/*.cpp:

  • [ ] Are possibly unused includes removed?

This is an automatically generated QA checklist based on modified files.

github-actions[bot] avatar Sep 17 '24 09:09 github-actions[bot]

What is the performance benefit from this? Is it even measurable in any way except by using a profiler?

10110111 avatar Sep 17 '24 09:09 10110111

What is the performance benefit from this? Is it even measurable in any way except by using a profiler?

I just wondered what takes so long just displaying InfoText. The commonInfoString was a surprisingly costly part of it, and here this seemingly trivial UTC lookup appears to be far from trivial.

gzotti avatar Sep 17 '24 09:09 gzotti

This pull request has conflicts, please resolve those before we can evaluate the pull request.

github-actions[bot] avatar Oct 04 '24 11:10 github-actions[bot]