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
11.34k stars 2.18k forks source link

Emulation reduced to ~20% of previous speed, since v0.9.5-251-g345a4cc #4508

Closed Elwood89 closed 10 years ago

Elwood89 commented 11 years ago

Hello!

On my S3 (Exynos/ Mali400) one of the commits between v0.9.5-245-gb310edc and v0.9.5-251-g345a4cc (there are no builds in between) made most games run much slower than before, about 1/5 of previous performance (ie. Wipeout runs 7 fps instead of 30-40). Heck, even the gray save screens are running at 6-7 fps ;).

Maybe this is known to you, as I see that you are working hard on the ARM JIT, and perhaps this is intentional, but since noone posted about this I decided to make an issue.

The changes between 9.5-245 and 9.5-251 were:

hrydgard commented 11 years ago

Thanks for reporting. Certainly not intended, I will investigate soon.

hrydgard commented 11 years ago

Do you have this speed issue in all games or just some? If so which ones?

jbakach commented 10 years ago

I notice that in all games, the games become too slow.

Elwood89 commented 10 years ago

The most demanding games took the biggest hit: Wipeout 35>7 fps GOW (menu) 18> 4 fps Locoroco 60>30 Ridge Racer 60>20-50fps Daxter seems unaffected (30/30 fps) Cars 1 - a bit slower, 10% maybe

The common "system" load/save screens are 7-8 fps in all games that use them.

Fei-Lix commented 10 years ago

I noticed this issue since that build was released and wanted to report it but I was thinking it might be a intended commit because I heard that second caching is disabled so it means expectedly it'll reduced a major % of speed. I tested: Hatsune Miku Project extend = at selecting menu (Free Play, DIVA Room, Rhythm Game, etc.) 85-100% into 45-54%. title menu seems fairly still at the same speed. PV seems still at the same speed?

hrydgard commented 10 years ago

I pushed a couple of experimental reverts, should result in a couple new builds to test to verify that it's not the texture hashing.

hrydgard commented 10 years ago

@RinkuFO , any big slowdown like that would be unintended. Sometimes we make changes that don't affect the devices we have or the games we test and don't notice that it slowed down other things. So reports like this are very useful.

I'm not seeing anything like a to-20% slowdown myself.

hrydgard commented 10 years ago

However I did notice that @unknownbrackets 's handcoded NEON texture hash is actually very slow. Code looks fine so no clue why, but I disabled it until we can investigate. Hope that that was the same problem you had.

unknownbrackets commented 10 years ago

For me, the handcoded one was faster (profiled several times.) So maybe it depends on the cpu?

Note that the function itself always takes a lot of time, either way.

-[Unknown]

unknownbrackets commented 10 years ago

What timing are you getting in the two versions?

-[Unknown]

hrydgard commented 10 years ago

With the handcoded texture hash, Wipeout when just out of the starting line on the first track runs at 27% on my nVidia Shield. With the other texture hash, it runs at 65-70%. So a pretty dramatic difference, something must be subtly broken.

hrydgard commented 10 years ago

My guess would be that it runs fast but one of the working registers is not cleared properly so it will end up mismatching hashes, creating too many textures.

vmov.i32 q0, #0\n

Does that really zero the full quad? I don't really know neon assembly language very well so I'm not sure.

hrydgard commented 10 years ago
  // Initialize cursor2.
  "movw r0, 0x0001\n"
  "movt r0, 0x0083\n"
  "movw r1, 0x4309\n"
  "movt r1, 0x4d9b\n"
  "vmov d2, r0, r1\n"
  "movw r0, 0xb651\n"
  "movt r0, 0x4b73\n"
  "movw r1, 0x9bd9\n"
  "movt r1, 0xc00b\n"
  "vmov d2, r0, r1\n"

Ah, the second d2 should be d3.

hrydgard commented 10 years ago

Fixed it.

unknownbrackets commented 10 years ago

Ah, darn it. I was only testing hashing speed not invalidation... (my main test case was a video that invalidated every single frame.)

-[Unknown]

hrydgard commented 10 years ago

Closing this as the problem is most likely fixed. @Elwood89 , please report here and reopen if you see it again.

Elwood89 commented 10 years ago

Correct, the problem is fixed, thank you!

Fei-Lix commented 10 years ago

@hrydgard sorry late reply, the problem is also fixed here, thanks!