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

PPSSPP profiling notes #15137

Closed
hrydgard opened this issue Nov 13, 2021 · 4 comments · Fixed by #15678
Closed

PPSSPP profiling notes #15137

hrydgard opened this issue Nov 13, 2021 · 4 comments · Fixed by #15678

Comments

@hrydgard
Copy link
Owner

hrydgard commented Nov 13, 2021

I'm messing around with a trial of Superluminal, which is a really powerful, although commercial, sampling profiler, that just like Very Sleepy works without defining scopes manually (though you can get better output if you do) but has a nice timeline view.

Taking down notes here of anything unexpected I find. Not sure how much the numbers are affected by running in the profiler though - I'm thinking, for Windows-message-dominated stuff like the dialog creation, maybe quite a bit?

Findings

First, pre-creating the debug dialogs is surprisingly slow, could probably simply create these on demand if we care about saving a bit of startup time on Windows:

image

Startup of the emu thread has some stuff, but is really not that slow (PPSSPP UI):

image

CleanRecent takes 200ms for me on Windows and probably more on mobile. It can probably be made faster or run in the background quite easily.

Related: #15135

@hrydgard
Copy link
Owner Author

hrydgard commented Nov 13, 2021

Profiling during actual gameplay was kinda disappointing because it can't handle JIT code in the stack. Might be possible to circumvent with the integration API though. Or just using the IRJit, which works - might be good enough to find some issues.

@hrydgard
Copy link
Owner Author

hrydgard commented Nov 21, 2021

There are some surprisingly large stalls due to vkAllocateMemory, that happen occasionally. An easy repro for me on Windows with NV is the "Suicide Barbie" homebrew demo.

(not clear in the picture, but it's almost 500ms)
image

In this case, we could easily do vkAllocateMemory on a thread, and only "finish" the "defragmentation" of the push buffer when done. Or allocate a larger buffer up front. Still, it's really weirdly slow here...

@hrydgard
Copy link
Owner Author

Actually from experience with other Vulkan allocators like VMA, I know that we are not doing things the way drivers expect these days. We should be making fewer much larger allocations, and suballocating more aggressively as needed, instead of every pushbuffer managing its own allocation.

In fact I'm considering just dropping our custom allocation code and just bringing in VMA, it's very battle tested now and is used by a large majority of commercial games that use Vulkan, if my information is correct.

@hrydgard
Copy link
Owner Author

#15162 fixes the Suicide Barbie stalls by integrating VMA...

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

Successfully merging a pull request may close this issue.

1 participant