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

Clicking on map to change location gets increasingly slower from click to click #3173

Closed
gzotti opened this issue Apr 11, 2023 · 21 comments · Fixed by #3180
Closed

Clicking on map to change location gets increasingly slower from click to click #3173

gzotti opened this issue Apr 11, 2023 · 21 comments · Fixed by #3180
Assignees
Labels
bug Something likely wrong in the code importance: high Obvious error, very annoying, but no crash state: confirmed A developer can reproduce the issue
Milestone

Comments

@gzotti
Copy link
Member

gzotti commented Apr 11, 2023

Expected Behaviour

Click on the map in LocationPanel sets new location within a short reaction time with every click

Actual Behaviour

Clicking 3-6 times to set various random locations takes longer and longer to set new location

Steps to reproduce

System

  • Stellarium version: 23.1
  • Operating system: Win11
  • Graphics Card: Geforce (likely irrelevant)

Logfile

Nothing suspicious

@gzotti gzotti added bug Something likely wrong in the code importance: high Obvious error, very annoying, but no crash labels Apr 11, 2023
@gzotti gzotti added this to the 23.2 milestone Apr 11, 2023
@10110111
Copy link
Contributor

Does it happen with Qt 5?

@gzotti
Copy link
Member Author

gzotti commented Apr 12, 2023

Unfortunately, yes. At least 5.15.2.

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

I can't reproduce the issue in macOS

P.S. When I/O is happened then choosing the location is a bit slowly of course

@gzotti
Copy link
Member Author

gzotti commented Apr 13, 2023

But it should not become slower and slower. Why does the 5th click already take several seconds (~twice the time of the 4th click) to compute coordinates from the map (or do something else in the background)? There is no landscape to load, what sort of heavy IO would be triggered?

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

But it should not become slower and slower.

Not in the macOS

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

Stop! This is really slow when atmosphere is disabled!

@gzotti
Copy link
Member Author

gzotti commented Apr 13, 2023

I have atmosphere on. But something unexpected must be going on here.
Is there a way (debug command) to let Qt write out triggered signal connections ?

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

Georg, please try follow:

  • Run Stellarium
  • Disable atmosphere
  • Open Location dialog
  • Disable showing stars (S)
  • Enable showing stars (S)
  • Random click on the map

What happening on your side?

@alex-w alex-w added the state: confirmed A developer can reproduce the issue label Apr 13, 2023
@github-actions
Copy link

Hello @gzotti!

OK, developers can reproduce the issue. Thanks for the report!

@gzotti
Copy link
Member Author

gzotti commented Apr 13, 2023

Same consecutive build-up of slowdown over several clicks. waiting 30s now...

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

Hmm... Setting time zones in setLocationFromMap may be removed, because it set in setFieldsFromLocation and the last one is called within setLocationFromMap

@alex-w
Copy link
Member

alex-w commented Apr 13, 2023

I found the problematic line!

See LocationDialog.cpp:199 (connect(core, SIGNAL(targetLocationChanged(StelLocation)), this, SLOT(updateFromProgram(StelLocation)));)

@gzotti
Copy link
Member Author

gzotti commented Apr 13, 2023

Maybe. But what happens here that slows it down? I had to set this to return to default location/landscape.
Why are there in StelCore::moveObserverTo() two emits which send locations?

@alex-w
Copy link
Member

alex-w commented Apr 14, 2023

I can't reproduce the issue in 23.1/Win10, but I see the problem in 23.1.104/Win10 O_o

@alex-w
Copy link
Member

alex-w commented Apr 14, 2023

OK, I've remarked line 199, builded the planetarium and run it.

  • Open Location dialog
  • Random clicks on the map without slowings
  • Select the Venus and Ctrl+G
  • Of course the map is not changed, but when I click on the map I see in the log:
"Can't create StelObserver on planet SpaceShip because it is unknown. Use Earth as default."
"Can't move from planet SpaceShip to planet Earth because it is unknown"

OK, other experiment. Revert commenting line 199 and disable code for mapWidget in setLocationUIvisible - everithing fast!

What is happened here? A cycle: mapWidget (emit positionChanged) -> LocationDialog (setLocationFromMap - > moveObserverTo) -> StelCore (emit targetLocationChanged) -> LocationDialog (updateFromProgram -> setLocationUIvisible) -> mapWidget (emit positionChanged)

@alex-w alex-w self-assigned this Apr 14, 2023
@alex-w alex-w closed this as completed in ec17f40 Apr 14, 2023
alex-w added a commit that referenced this issue Apr 14, 2023
@gzotti
Copy link
Member Author

gzotti commented Apr 14, 2023

I see for this use case it is OK now. But it may have not cleared the original problem. But #3171 is then still not good. I don't know why the loading of best place takes so long, even with Preetham atmosphere. Maybe a similar loop. So, we'd better review the connected actions...

@alex-w
Copy link
Member

alex-w commented Apr 14, 2023

@gzotti please check master

@gzotti
Copy link
Member Author

gzotti commented Apr 14, 2023

Selecting a contact time from the lower box works. However, should selecting the main line in the upper dialog not also set best location? This occasionally works, but more than often does nothing.
I just made sure to load the zero landscape (2c6a603). Whatever landscape you currently have, you will almost certainly be taken elsewhere...

@gzotti
Copy link
Member Author

gzotti commented Apr 16, 2023

This was not a good fix. Select SolarSystemObserver and click into the image. The solution in #3180 seems to work.

@gzotti gzotti reopened this Apr 16, 2023
@gzotti gzotti assigned gzotti and unassigned alex-w Apr 16, 2023
@alex-w alex-w added the state: published The fix has been published for testing in weekly binary package label Jun 18, 2023
@github-actions
Copy link

Hello @gzotti!

Please check the fresh version (development snapshot) of Stellarium:
https://github.com/Stellarium/stellarium-data/releases/tag/weekly-snapshot

@alex-w alex-w removed the state: published The fix has been published for testing in weekly binary package label Jul 2, 2023
@github-actions
Copy link

github-actions bot commented Jul 2, 2023

Hello @gzotti!

Please check the latest stable version of Stellarium:
https://github.com/Stellarium/stellarium/releases/latest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something likely wrong in the code importance: high Obvious error, very annoying, but no crash state: confirmed A developer can reproduce the issue
Development

Successfully merging a pull request may close this issue.

3 participants