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

Optimize max number of Pathfinding threads for high core/thread count CPUs #1744

Merged
merged 1 commit into from
May 23, 2023

Conversation

krzychu124
Copy link
Member

  • reduced max number of thread created based on detected CPU threads to 10

@krzychu124 krzychu124 added enhancement Improve existing feature performance Make it faster! PATHFINDER Pathfinding tweaks or issues labels May 23, 2023
@krzychu124 krzychu124 added this to the 11.8.0 milestone May 23, 2023
@krzychu124 krzychu124 self-assigned this May 23, 2023
@kvakvs
Copy link
Collaborator

kvakvs commented May 23, 2023

Just considering how many cores the game needs to run, 2-4 maybe? Give it a better informed decision than my guess here. And you can safely allocate most or all of the remaining cores.

@krzychu124
Copy link
Member Author

Just considering how many cores the game needs to run, 2-4 maybe?

It can use way more than 4, just not at full load. Depends on what savegame you try, but also what GPU you have, since Unity Engine is allocating additional background threads for rendering (in my case 16 worker threads).

Below, 655k map, vanilla + TM:PE and FPS Booster only, you can see it's fairly stable 35% of 32 available CPU threads. 6-8 with almost constant 100% are main, simulation and few most used pathfinding threads. It doesn't really need more than 10 (for sure not 28 as previously was😂) since there is no demand (pf counter is <25 all the time) and cannot be higher since count of citizens and vehicle instances are bounding of the limit.
image

@krzychu124 krzychu124 merged commit 45b11da into master May 23, 2023
@krzychu124 krzychu124 deleted the improvement/reduce-number-of-pf-threads branch May 23, 2023 22:50
@krzychu124 krzychu124 mentioned this pull request May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve existing feature PATHFINDER Pathfinding tweaks or issues performance Make it faster!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants