Author Topic: [Release] Thread Optimizer - adjust thread parameters to achieve max performance  (Read 4646 times)

Offline Graphene

  • Refugee
  • **
  • Posts: 62
    • View Profile
Thread optimizer is plugin + config application set that allows you to adjust thread priority and CPU affinity mask of any threads created by game to achieve maximum performance.

Disclaimer:

This plugin is intended for users who at the very least understand the concept of threading.
If you have no idea what you are doing, you have the option to wait until someone else shares their preset for the game you want.


I am not responsible for any lost game progress or corrupted savedata caused by improper thread adjustments.

Please read all instructions carefully before installing!

1. Required plugins:

Thread Optimizer requires following plugins to be installed on your system:
- CoreUnlocker80000H (https://forum.devchroma.nl/index.php/topic,203.0.html).
- ioPlus (https://forum.devchroma.nl/index.php/topic,205.0.html).

Make sure you have both of them installed before continuing.

2. What is snapshot?

Snapshot is the file that holds information about all threads that game has created. Once snapshot has been made, it is also used as preset to store user-edited thread parameters.
Snapshot contains following information for each of the threads:
- CRC16 (checksum used to identify thread)
- Thread entry function address (used only to calculate CRC16)
- Thread name
- Thread priority <- can be edited in config app
- Thread CPU affinity mask <- can be edited in config app

3. Thread parameters that you can change:

- CPU afiinity mask
Determines wich CPU cores will be allowed to run the thread.

- Priority
Determines thread priority. Lower the number, higher the priority. It is not recommended to adjust it unless you know what you are doing.

4. Usage procedure:

- Install plugin and application.
Plugin can be installed under *ALL or under games you want to use it with.

- Launch the game you want to create preset for.

- Take a snapshot of game threads by holding LTRIGGER + RTRIGGER + SQUARE until you see notification.
Since snapshot accumulates all thread data since the game start, it is recommended that you at least get into the actual gameplay before taking a snapshot.
You can delete snapshot you just created by holding LTRIGGER + RTRIGGER + TRIANGLE. However, snapshots that has been taken in different game session can only be deleted from config app.

- Exit the game, open config app and adjust thread parameters of the snapshot and save it.

- Open the game again. New thread parameters will be applied automatically.

- You can delete snapshot from config application if you are not happy with your adjustments and start from scratch.

- Snapshots are stored in ux0:data/ThreadOptimizer/*titleid*/
Snapshots do not contain any personal data and can be shared with other users.

5. Current limitations:

- Parameters of the main thread cannot be adjusted.
- Threads that have same name, entry function address, priority and CPU affinity mask are considered to be the same.

Download here: https://github.com/GrapheneCt/ThreadOptimizer/releases

Example of good snapshot profile (download link in the video description):

With Thread Optimizer:



Same level without Thread Optimizer:

« Last Edit: July 03, 2020, 05:01:08 PM by Graphene »

Offline Graphene

  • Refugee
  • **
  • Posts: 62
    • View Profile
Fixed an issue that caused some games not registering an input.

Offline Graphene

  • Refugee
  • **
  • Posts: 62
    • View Profile
Thread Optimizer has been updated:

- Adds support for threads created by PTHREAD_PRX module (unity games).
- Adds support for threads created by SceLibc module (??? games).

Only plugin was updated, no need to reinstall .vpk if you already have it installed.

Offline Graphene

  • Refugee
  • **
  • Posts: 62
    • View Profile
Thread Optimizer has been updated yet again:

- Fixed thread detection (previuosly entry function address was used, now CRC16 is used)

Offline Graphene

  • Refugee
  • **
  • Posts: 62
    • View Profile
Due to the popular demand, here is the good example of TO profile for Killzone Mercenary made by zanderman2009.
Download link in the video description:

With Thread Optimizer:



Same level without Thread Optimizer:

« Last Edit: July 03, 2020, 05:00:39 PM by Graphene »

Offline ZeeThirtyTwo

  • End User
  • *
  • Posts: 1
    • View Profile
So I played around with the snapshot for Jak and Daxter: The Precursor Legacy US version (PCSA00080) for a few hours and have all four cores being used quite heavily. I have tested the first four areas, not including Misty Island, at native resolution, capped at 30fps via Vitagrafix and 500Mhz through PSVshell v1.1. The game runs at 30fps most of the time and drops to about 25fps when drawing long distances. The game typically hovers between about 30fps to 45fps sometimes hitting 60fps when the cap is raised and resolution lowered. Raising the cap to 60fps makes the game run at half speed when the framerate is chugging along between 30fps to 45fps, so realistically we won't be able to play the game at 60fps ever.

I'm sure there's still plenty of tweaking to be done with better understanding of what the threads I'm assigning to cores actually do. I have not compared this to stock clocks without Thread Optimizer enabled since I know the game shipped sub native resolution with a 20fps cap. I plan on continuing to try to improve performance in this and other games on my spare time and would love to see what others can achieve with this awesome plugin. Many thanks to Graphene.

I have attached my current modified snapshot to this post (07/03/2020). Copy and paste the unzipped folder to your ux:0/data/ThreadOptimizer folder. Let me know how this works out for you and maybe we can achieve a locked 30fps at native resolution in the future!
« Last Edit: July 04, 2020, 04:56:05 AM by ZeeThirtyTwo »

Offline justalex

  • End User
  • *
  • Posts: 2
    • View Profile
Hey, I've made more progress on Killzone Mercenearies - I'm a bit of a perfectionist so I've made a console like profile - super smooth, consistent FPS - and a combat profile - lightning fast combat and low input latency by the looks of it, it'll keep up however fast you can shoot ;)

I've attacvhed the high performance profiles and only called them that because of the performance. I've tested them a good bit and the vita never breaks a sweat or ever freezes or crashes and never goes above 31c which is standard temps without a profile, the vita is a cracking piece of hardware.

Here's what the combat profile looks like
https://youtu.be/DtmWfZvLMdE

And this is the console profile:
https://youtu.be/db4VnDdPJJg

Both profiles are attached to this post


NOTE: Turning off native resolution is fantastic
https://youtu.be/jbW1U4kqWdQ

EDIT NOTE: This is all on 444mhz clock speed, I find it plays smoother. It doesnt happen all the time but it can feel like 500mhz can throw the profile a curve ball and it'll sometimes slowdown, that and I tested the profile exclusively on 444mhz :)
« Last Edit: Today at 02:44:58 PM by justalex »

Offline justalex

  • End User
  • *
  • Posts: 2
    • View Profile
I messed around with Uncharted for a little bit, the problem is getting the cpu to rev up at all but I managed a bit more cpu usage. I was thinking it might be better trying single cores for each thread as multicore seems to kill cpu usage.