dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Improve stack frames for profilers

Open TellowKrinkle opened this issue 3 years ago • 1 comments

Some sampling profilers rely on the frame pointer to recover stack frames for samples.

Don't add -fomit-frame-pointer on RelWithDebInfo builds

I also added stack frames to the vertex loader functions, but if that ends up affecting performance, I can remove that, since it's really only useful for profilers without a JIT function declaration API.

TellowKrinkle avatar Aug 11 '22 04:08 TellowKrinkle

Yes it would definitely be good to check perf impact of that jit modification

shuffle2 avatar Aug 21 '22 21:08 shuffle2

Not sure what aspect needs to be stressed to test it but the performance is pretty much the same.

F-Zero: Sand Ocean intro

❯ gfx-render-time \
  --dolphin /Applications/Dolphin/master\ 5.0-17627-9222956-9222956.app -r 3 \
  --dtm F-Zero\ Sand\ Ocean\ Intro.dtm \
  --config=Graphics.Settings.InternalResolution=1
1/3 metal.........................8.401ms
Run completed. Sampled 11436 frames.
2/3 metal..........................8.388ms
Run completed. Sampled 11436 frames.
3/3 metal.........................8.381ms
Run completed. Sampled 11436 frames.
11436 frames 8.401ms metal pass 1
11436 frames 8.388ms metal pass 2
11436 frames 8.381ms metal pass 3
34308 frames 8.390ms complete

❯ gfx-render-time \
  --dolphin /Applications/Dolphin/StackFrames\ 5.0-17630-0903f3c-9222956.app -r 3 \
  --dtm F-Zero\ Sand\ Ocean\ Intro.dtm \
  --config=Graphics.Settings.InternalResolution=1
1/3 metal.........................8.387ms
Run completed. Sampled 11436 frames.
2/3 metal..........................8.381ms
Run completed. Sampled 11436 frames.
3/3 metal.........................8.382ms
Run completed. Sampled 11436 frames.
11436 frames 8.387ms metal pass 1
11436 frames 8.381ms metal pass 2
11436 frames 8.382ms metal pass 3
34308 frames 8.383ms complete

Super Mario Galaxy: hub area

❯ gfx-render-time \
  --dolphin /Applications/Dolphin/master\ 5.0-17627-9222956-9222956.app -r 3 \
  --dtm smg.dtm \
  --config=Graphics.Settings.InternalResolution=1
1/3 metal...............9.637ms
Run completed. Sampled 5654 frames.
2/3 metal
Warning! Early termination! Sampled 0 frames.
3/3 metal...............9.335ms
Run completed. Sampled 5654 frames.
 5654 frames 9.637ms metal pass 1
 5654 frames 9.335ms metal pass 3
11308 frames 9.486ms complete

❯ gfx-render-time \
  --dolphin /Applications/Dolphin/StackFrames\ 5.0-17630-0903f3c-9222956.app -r 3 \
  --dtm smg.dtm \
  --config=Graphics.Settings.InternalResolution=1
1/3 metal..............9.266ms
Run completed. Sampled 5654 frames.
2/3 metal
Warning! Early termination! Sampled 0 frames.
3/3 metal...............9.349ms
Run completed. Sampled 5654 frames.
 5654 frames 9.266ms metal pass 1
 5654 frames 9.349ms metal pass 3
11308 frames 9.308ms complete

Second run causes an error since wii games do not like being killed of so quickly. Something to fix in the script.

dvessel avatar Oct 21 '22 09:10 dvessel

I'm not sure which game/recording would make a good test, but at least there was a sanity check - thanks! So seems fine.

shuffle2 avatar Oct 21 '22 17:10 shuffle2