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

SuperTuxKart is slow with 10000 invisible object #3780

Open
MatthewsSam opened this issue Mar 2, 2019 · 7 comments
Open

SuperTuxKart is slow with 10000 invisible object #3780

MatthewsSam opened this issue Mar 2, 2019 · 7 comments
Assignees
Milestone

Comments

@MatthewsSam
Copy link
Member

If we load 10 000 invisible objects in SuperTuxKart it will render the scene at 30 FPS (while it's 100 if there are no objects).

It's ridiculous to go down to 30 FPS for only 10 000 objects which are not even displayed.

After quick investigation it might be because currently ISceneNode uses CORE::LIST which is a linked list. Linked list are slow for quick iteration needed by the scene manager for the rendering.

@auriamg
Copy link
Member

auriamg commented Mar 2, 2019

After some tests, while the use of a linked list is a bit unexpected, that doesn't seem to be the root cause of the slowdown.

@auriamg
Copy link
Member

auriamg commented Mar 2, 2019

LODNode::OnAnimate appears to be a major source of slowdowns, I get a 15 FPS gain if I remove it.

... and if I totally remove all calls to OnAnimate, I gain another 15 FPS (total 30 FPS gained by removing those calls!)

@MatthewsSam
Copy link
Member Author

So after some tests with a profiler:

  • Removing all call to onAnimate() in the extreme lod scenario (10000 objects with LoD) increased the FPS by ~30
  • One of the slowest thing was computing at which level the LoD should be displayed (this could be spread out over the rendering probably)
  • After some modification, the slowest thing was the infamous object culling

@auriamg
Copy link
Member

auriamg commented Mar 4, 2019

Early prototype of possible improvement pushed to branch "3780-scene-optimisation"

@MatthewsSam
Copy link
Member Author

So after trying your branch + auto LoD on amazon the track Black Forest I got:
75 FPS with the current master
85 FPS with the prototype branch
91 FPS with auto LoD

@Alayan-stk-2 Alayan-stk-2 modified the milestones: 1.1, 1.2 Oct 22, 2019
@Alayan-stk-2 Alayan-stk-2 modified the milestones: 1.2, 1.3 Aug 23, 2020
@Benau
Copy link
Contributor

Benau commented Sep 2, 2022

according to #3805 (comment) it should be faster now

@Benau Benau closed this as completed Sep 2, 2022
@Alayan-stk-2
Copy link
Collaborator

Testing the Lodtest track while making everything invisible by returning automatically "-1" (don't display) when checking the LoD level.

Compiled in STKRelease mode, using OpenGL.

1.0 : ~100FPS
Master with the invisible objects : ~230FPS
Master with the objects removed through the "very low" setting : ~750FPS

While there is a very clear improvement, the perf cost of invisible objects is still way too high.

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

5 participants