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

Call UpdatePerformanceMonitor when needed #9355

Merged
merged 4 commits into from Dec 27, 2020

Conversation

JosJuice
Copy link
Member

I find the performance monitor functionality useful for timing hardware tests, but unfortunately it hasn't worked correctly in Dolphin except when using the x86-64 JIT with no idle skipping. This PR makes it work (mostly) correctly on all CPU emulation cores.

m_code.emplace_back(EndBlock, js.downcountAmount);
m_code.emplace_back(UpdateNumLoadStoreInstructions, js.numLoadStoreInst);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are any games known to use these counters? If not, two calls at the end of every block is steep price to pay. Have you considered replicating the MCR check that is in the JIT? It's definitely a hack, but it seems justifiable if the feature is only exercised by test code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No games use them as far as I know. (We should've gotten reports about things breaking on ARM by now otherwise.)

I was a bit unsure if I should add that hack here or not when I was working on the code. But I'd like to have input from one more person before switching it over.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you measured the performance impact?

Copy link
Member Author

@JosJuice JosJuice Dec 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it now, and it actually seems to be running one FPS faster with this change than without. I'm going to assume it's just a random variation and not an actual performance improvement. (The scene I used was the file select screen in Anubis II, which runs at about 33 FPS for me. The scene has 3D graphics but is otherwise relatively light.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's not worth porting the speed hack to the interpreter, then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, never mind about no games using them. Harry Potter and the Prisoner of Azkaban uses them according to cdace9d, and that game has indeed been known to be broken in JitArm64.

@leoetlino leoetlino merged commit 4705af5 into dolphin-emu:master Dec 27, 2020
10 checks passed
@JosJuice JosJuice deleted the perfmon branch December 27, 2020 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants