Cache UTC offset
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):
With this caching:
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
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.
What is the performance benefit from this? Is it even measurable in any way except by using a profiler?
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.
This pull request has conflicts, please resolve those before we can evaluate the pull request.