Skip to content

Use an ID for planets for faster comparison - #5000

Draft
gzotti wants to merge 4 commits into
masterfrom
speedup/planetID
Draft

gzotti wants to merge 4 commits into
masterfrom
speedup/planetID

Conversation

@gzotti

@gzotti gzotti commented Jun 22, 2026

Copy link
Copy Markdown
Member

EXPERIMENTAL DRAFT, ignore!

VTune indicates that a considerable percentage of frame time is string comparison in the solar system, i.e., comparing englishName. This branch tries to mitigate the situation, first by using a hash-based ID.

Description

Fixes # (issue)

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • 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: Windows 11
  • Graphics Card: irrelevant

Checklist:

  • My code follows the code style of this project.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (header file)
  • I have updated the respective chapter in the Stellarium User Guide
  • 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

- using qHash(englishName, 0)
@gzotti gzotti added this to the 26.3 milestone Jun 22, 2026
@gzotti gzotti self-assigned this Jun 22, 2026
@gzotti gzotti added enhancement Improve existing functionality importance: medium A bit annoying, minor miscalculation, but no crash labels Jun 22, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in Solar System Jun 22, 2026
@github-actions
github-actions Bot requested review from 10110111 and alex-w June 22, 2026 16:45
@github-actions

Copy link
Copy Markdown

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

Copy link
Copy Markdown

Hello @gzotti!

Thank you for the suggested improvement.

@alex-w

alex-w commented Jun 22, 2026

Copy link
Copy Markdown
Member

How many objects in your ssystem.ini files and how many increases performance?

@gzotti

gzotti commented Jun 22, 2026

Copy link
Copy Markdown
Member Author

I have started editing about 2 hours ago and wrote "EXPERIMENTAL DRAFT, ignore!" above. If VTune was right, 15-20% of SolarSystem::draw() goes into string equality tests with a solar system of around 11.000 objects.
Another repeated call seems to be getSolarEclipseFactor which is called in SolarSystem::draw and then in each Planet::draw. And StelCore::getProjection is also called twice, but I have not checked yet where and whether these are same-named overloads. In the best case, their results could be re-used.

@github-actions github-actions Bot added the has conflicts The pull request has conflicts label Aug 14, 2026
@github-actions

This comment was marked as outdated.

@gzotti gzotti modified the milestones: 26.3, 26.4 Aug 26, 2026
@github-actions github-actions Bot removed the has conflicts The pull request has conflicts label Aug 26, 2026
@github-actions

Copy link
Copy Markdown

Conflicts have been resolved. A maintainer will review the pull request shortly.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve existing functionality importance: medium A bit annoying, minor miscalculation, but no crash

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants