hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
10.99k stars 2.14k forks source link

Integrate a better CPU profiler #13220

Open hrydgard opened 4 years ago

hrydgard commented 4 years ago

It's very hard to get any kind of overview of how CPU is used by PPSSPP, even with the kinda lacking builtin profiler (which needs to be enabled by compile flag currently).

Recently in other work I've come across some really cool frame profilers that let you specifically look at performance spikes (which can lead to stutters) very easily, and I'd like to integrate one in PPSSPP. The idea is that it saves a copy of the profile of the slowest frame so far, so you can investigate it in detail. You can clear the current "slowest" frame at any time, too.

I'll collect a list of candidates here before I make a decision. Additional suggestions appreciated! Not sure if all of these can actually do the spike profile thing though.

(not interested in non-open-source solutions here like superluminal, framepro or RAD tools)

unknownbrackets commented 4 years ago

I'm still using VerySleepy, not because it's perfect by any means, but because I hacked in support for showing jit funcs to it so I can see how the game code and jit is contributing to the profile. Although, seems it's getting newer commits, haven't bothered to update my hacks to latest:

https://github.com/VerySleepy/verysleepy/commits/master

See #4692. Would be nice to do this in some better way, though.

-[Unknown]

hrydgard commented 4 years ago

VerySleepy is fine as a sampling profiler. In this case I'm looking for "region profilers" that can show when certain marked blocks are executing on a per-thread basis on a timeline. This allows easily narrowing down the cause of frametime spikes. The builtin profiler can kind of do this but not as well as some I've tried (that we can't use for various reasons).

One example, although for Rust, is https://github.com/EmbarkStudios/puffin .