Skip to content

[Testers Needed][Performance] SPU: Task-based SPURS limiter - #16109

Merged
elad335 merged 4 commits into
RPCS3:masterfrom
elad335:uwu
Sep 24, 2024
Merged

elad335 merged 4 commits into
RPCS3:masterfrom
elad335:uwu

Conversation

@elad335

@elad335 elad335 commented Sep 21, 2024 •

Copy link
Copy Markdown
Contributor

Instead of limiting how many SPURS threads are initialized, limit how many concurrent SPURS tasks are active at the same time.
Makes it compatible with The Last Of Us (because it uses the last thread in its group for special tasks, this should make it be able operate at times too).
May perform differently than the how it the SPURS limiter was before, needs testing.

Edit: this has effect on the SPURS limiter setting in advanced tab, when setting to other values than unlimited.

From @MsDarkLow testing SPURS limit:
Yakuza Dead Souls, 58.3 -> 68.1
Sonic Unleashed, 28.7 -> 44.1

@LoweysLitsman

Copy link
Copy Markdown
Contributor

Raptor Lake CPU @ 4GHz & set to 4 Cores and 4 Threads, in the BIOS.
Yakuza Dead Souls can now be set to Max SPURS 3 (minimum is 1&2 but the audio breaks really bad), which helps performance for corelets. Before the max was 5.
Sonic Unleashed can now be set to Max SPURS 2, which tremendously helps performance for corelets. Before the max was 4.

Yakuza Dead Souls, 58.3 -> 68.1

YDS 4c4t 4ghz - Master SPURS 5
YDS 4c4t 4ghz - PR SPURS 3

Sonic Unleashed, 28.7 -> 44.1

SU 4c4t 4ghz - Master SPURS 4
SU 4c4t 4ghz - PR SPURS 2

@elad335 elad335 changed the title [Experimental] SPU: Task-based SPURS limiter [Testers Needed][Performance] SPU: Task-based SPURS limiter Sep 21, 2024
@bigol83

This comment was marked as off-topic.

@AniLeo

This comment was marked as off-topic.

@bigol83

This comment was marked as off-topic.

@AniLeo

AniLeo commented Sep 21, 2024

Copy link
Copy Markdown
Member

Same settings with both main and PR, i can't see a real difference in The Last of Us performance.
I have i5 12400f 6 cores 12 threads

master does not support Max SPURS Threads on TLOU so that makes no sense.

Ok, let me explain better, there is no performance difference between main and PR unlimited spurs option in TLOU, but i guess this won't make a difference for people starting with 6 cores and 12 threads cpus.

That much is obvious, because using Unlimited means you're not testing any of the code in this PR. This is modifying the behaviour when using the Max SPURS Threads setting, notably allowing a lower count on some games, which helps thread starved CPUs.

@RPCS3 RPCS3 deleted a comment from EmulationChannel Sep 21, 2024
Comment thread rpcs3/Emu/Cell/SPUThread.cpp Outdated

case SPU_RdEventStat:
{
const bool is_spurs_task_wait = pc == 0x11a8 && group->max_run != 6 && spurs_addr;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we move some of the thread scheduling to their own files/classes? It would greatly improve readability. It's something the emulator really needs in general.
In particular this case is so long it kinda breaks all expectations of what a switch-case should be. Just something to think about.

@elad335

elad335 commented Sep 23, 2024

Copy link
Copy Markdown
Contributor Author

Pushed an update that may or may not improve performance, also fixes crashes with RawSPU.

@elad335 elad335 added the Optimization Optimizes existing code label Sep 23, 2024
@elad335

elad335 commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

Performance regressions -> https://github.com/RPCS3/rpcs3/issues/new/choose

@elad335
elad335 merged commit 4b0a5bd into RPCS3:master Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CPU Enhancement Optimization Optimizes existing code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants