-
-
Notifications
You must be signed in to change notification settings - Fork 838
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
Bad performance for boundaries #2836
Comments
Does this also happen with |
Also to some degree present on Windows. Especially noticeable at wide FOV. |
No |
Hello @alex-w! OK, developers can reproduce the issue. Thanks for the report! |
@10110111 any ideas where is the source of issue? |
Apparently, the geometric shader works slowly. But it's so basic, that I don't know how it could be optimized. |
Today we tested 1.2RC2 on Intel Mac and the issue is not reproducible, so, apparently this is problem specific for arm-macs (at least for M1). |
I can confirm the boundaries are "expensive" also on Win11, dropping from 60 to 52 fps in wide-angle view. But also gridlines, GUI dialogs and InfoText displays are (and always have been) costly. I have not tested previous versions on this notebook, though. A drop to 1/4 would be bad, indeed. Is that only boundaries, or also the gridlines? |
The core issue is the CPU cost here in drawing lines and text: We should not be creating a new QOpenGLPaintDevice in Aside from that, the text drawing appears to be the most costly and should be addressed, but I haven't figured out what the core cause is of the slow performance to have any suggestions about making the text draw faster. I suspect it is due to constant rerasterization or recomputation of the layout of the text but I'm not sure. More profiling will be needed. |
This might be one of the reasons, but not the only one. Lines used to work faster. But, do you get any improvement if you make this variable |
I finally managed to build stellarium on my macos and I can confirm that simply making the variable static makes my frame rate go from about 7 FPS to about 20 FPS (from about 143 ms per frame to about 50 ms per frame) for about a 2.8x speedup. Totally worth doing, but given that the CPU time associated with the destructor only takes up 10%, there must be some sort of GPU pipeline flush or sync that occurs with the construction/destruction of the QOpenGLPaintDevice that causes a much larger performance problem on the GPU side. I'll try to dig more but simply making that var static has a really big boost. |
This is not related to boundaries, right? Because I don't see any text associated with them. |
@unpacklo thank you for investigating the problem. Could you send us pull request with patch? |
@10110111 ah sorry, I was confused with another issue. I don't see the problem with boundaries at the moment, but I am seeing big performance problems on my Intel MacBook Pro (2019).
@alex-w Yes, I intend to open a PR once I've figured out why making it static improves performance so much. |
Very slow and lags on version 1.2 when enabling the "show boundaries" option. Macbook air running MacOS Ventura 13.2. |
This is weird. macOS 13.2.1 (M1), current master + Qt5 - no penalty of performance when boundaries are enabled. Current master + Qt6 - the issue is here. |
We can so much need a profiling expert to point out bottlenecks! |
One major difference between Qt5 and Qt6 is that in Qt5 only integral scaling factors are supported (any fraction is rounded), while Qt6 supports fractional factors. You might be observing no slowdown with e.g. 100% effective (i.e. from Qt's PoV) pixel ratio, while a slowdown appears with higher pixel ratio. |
But why Qt6-based packages doesn't have the issue on Mac's with Intel CPU? |
If the issue only appears on non-Intel, this may just mean that Intel have been capable of making GPUs that run geometry shaders with sensible performance. Just to check, what pixel ratio do you have on the machines where this slowdown happens? I'm interested in both Qt5 and Qt6 perspectives. Also, was the line width setting changed from the default on these machines? |
Device pixel ratio is 2 |
In both cases? |
Yep |
Hello @alex-w! Please check the fresh version (development snapshot) of Stellarium: |
Hello @alex-w! Please check the latest stable version of Stellarium: |
Expected Behaviour
Good performance to rendering boundaries of constellations
Actual Behaviour
Bad performance to rendering boundaries of constellations - after enabling displaying boundaries FPS dramatic decreases in 4 times
Steps to reproduce
B
)System
Logfile
log.txt
The text was updated successfully, but these errors were encountered: