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

[4.0 a1] Performance issues & script profiler not working #57309

Closed
Zireael07 opened this issue Jan 27, 2022 · 7 comments
Closed

[4.0 a1] Performance issues & script profiler not working #57309

Zireael07 opened this issue Jan 27, 2022 · 7 comments

Comments

@Zireael07
Copy link
Contributor

Zireael07 commented Jan 27, 2022

Godot version

4.0 alpha 1

System information

Linux Manjaro, Vulkan, Intel Kaby Lake

Issue description

Very simple testing scene has massively degraded performance compared to the Godot 3 version.

Godot 3 had 30+ fps in this scene. Godot 4 has 11-12 (!!!!) and monitor shows process to be at fault, taking HUNDREDS of ms. The project is basically a ported project from Godot 3, no code changes apart from API upgrades and some things removed/commented out to get it running (so if anything, there's LESS code now than there used to be, so it should run better). This seems to point at some sort of an engine regression!

Cannot debug it further as script profiler doesn't work (can't switch it on after running the scene, if I press start before running the scene/project it just stays empty)
Interestingly, remote scene tree works fine <3

Steps to reproduce

Open the project below, try to run Spatial_simple.tscn.

(Don't pay attention to some meshes/UI elements being in weird spots or not working, like the mirror, or, well, the kinematic car not moving :P)

@ me if it doesn't run on your computer, since it likely means I missed committing some fix/file.

Minimal reproduction project

Not minimal :P

Zireael07/FreeRoamRoguelikeRacerPrototype@d8cc2df

@Calinou
Copy link
Member

Calinou commented Jan 27, 2022

Could you try to compile a debug build of the editor and use a C++ profiler to run it?

@Zireael07
Copy link
Contributor Author

I probably could - I did it a couple of times with the earlier builds but a) not any time soon (weekend at the earliest - day job takes up time) and b) I suspect it's some sort of a user error on my end, like misusing the new dynamic character API or something. (Since well, the car doesn't move and it should :P )

@Zireael07
Copy link
Contributor Author

Zireael07 commented Jan 27, 2022

Good news, I found the culprit - replacing the Godot 3 sky setup with a vulkan setup completely fixed the issue. This means this performance regression is likely something to do with subviewports +cameras - and further proof of that is in the fact that I still see slightly worse performance when switching to cockpit view, which has a (non-working) mirror which is also a subviewport.

The Godot 3 sky setup was a bit arcane, but in essence it boiled down to a sprite2d that was being seen by a camera2d that was then applied to a subviewport (with a timer to avoid updating too often) and this viewport's texture was used as a sky texture

Zireael07/FreeRoamRoguelikeRacerPrototype@91ea645

@Zireael07
Copy link
Contributor Author

(I didn't close the issue because there's STILL the problem of the script profiler NOT working AT ALL)

@Calinou
Copy link
Member

Calinou commented Jan 27, 2022

(I didn't close the issue because there's STILL the problem of the script profiler NOT working AT ALL)

This is already reported in #44252, so I'll close this issue as a duplicate of #44252.

@Zireael07
Copy link
Contributor Author

Got it. I'll reopen if I manage to get a debug build and find out what is going on with the viewports regressions, though.

@Calinou
Copy link
Member

Calinou commented Jan 27, 2022

Got it. I'll reopen if I manage to get a debug build and find out what is going on with the viewports regressions, though.

It's likely that viewports became more expensive to instance and housekeep: #48978

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants