- 수정됨
[Libgdx] weird performance issues
I have fairly complex avatars in game im working on.
On nexus 4, in test app, i can run 10 of them at 60fps. I can insert some labels in between to cause a flush each time without major drop.
On nexus 4, in real app, i can run 2 with 20fps. I can disable drawing only, for 60 fps. There are 4 render calls total for entire screen. I dont think im doing anything obviously stupid.
Anything obvious a should take a look at? Thanks.
What is a test app? What is a real app? If you have a debugger connected, it'll wreck performance.
There are some fields on SpriteBatch (and similar batches) that might help, though it sounds like you are already monitoring batching.
https://github.com/libgdx/libgdx/wiki/Spritebatch%2C-Textureregions%2C-and-Sprites#performance-tuning
What i meant to say, was texture switches i guess.
Test app is a fresh libgdx project, with spine dependency and relevant junk for rendering avatars.
Real app is the actual project, with all the other junk. Like actual game and what not.
Ive been testing without debugger attached, im quite sure.
At any rate, running a release build with proguard helps quite a bit. Perhaps whatever stupid thing im doing is optimized out.
I suggest to use a profiler. Anything else is poking at the dark. If the test app runs smoothly, there is no reason for the same code paths to perform worse in your real app.
Profiler did point me in the spine direction. I also added a toggle to disable spine rendering during runtime and it results in instant performance improvement.
At any rate, i dont think the spine rendering is the issue in itself. Whatever happens in debug build to facilitate debugging seems to be an issue. Real app is a lot more complex then the test app, it probably adds up to large impact.