CPU Performance Patch (Up to 30% faster physics, up to 60% more FPS)

Other CPU Performance Patch (Up to 30% faster physics, up to 60% more FPS)

those are mostly made up parameters lol. I will try to delay the GC to the GPU rendering though, the CPU is doing nothing in that time.
so disabling the GC between rendering frames gives me insane FPS boosts in animated scenes and scene loading, as predicted. But the RAM usage keeps growing between different scenes lol.
 
so disabling the GC between rendering frames gives me insane FPS boosts in animated scenes and scene loading, as predicted. But the RAM usage keeps growing between different scenes lol.
I think you can configure VAM to do memory cleanup when loading scenes or presets (performance 2 tab in settings) so that should be fine I guess?
 
I think you can configure VAM to do memory cleanup when loading scenes or presets (performance 2 tab in settings) so that should be fine I guess?
Yes, eventually the memory gets cleaned up after a few more scenes. I guess unity keeps still a link to the previous scene, but once you load yet another scene, the assets of the first one get cleaned up.
 
How fast does it grow? I have 128GB and I really like the idea of "insane FPS boosts".
How does one disable the garbage collector between rendering frames?
I had to manualy find the offset in mono.dll since this unity version doesnt support it.
imported_mono_gc_enable = (tmono_gc_enable)((LPBYTE)hMono + 0x158E8C);
imported_mono_gc_disable = (tmono_gc_disable)((LPBYTE)hMono + 0x158EB8);
 
I had to manualy find the offset in mono.dll since this unity version doesnt support it.
imported_mono_gc_enable = (tmono_gc_enable)((LPBYTE)hMono + 0x158E8C);
imported_mono_gc_disable = (tmono_gc_disable)((LPBYTE)hMono + 0x158EB8);
I just tried that on Benchmark 3 but not seeing any FPS improvements. I'm only seeing vam using 27gb of ram after running it :D (normally it uses 15gb after benchmark 3)
At least my game didn't crashed after calling this ptr.
maybe you have to call it right after loading a scene or smth
 
I just tried that on Benchmark 3 but not seeing any FPS improvements. I'm only seeing vam using 27gb of ram after running it :D (normally it uses 15gb after benchmark 3)
At least my game didn't crashed after calling this ptr.
maybe you have to call it right after loading a scene or smth
mono_gc_disable increments an internal int, mono_gc_enable decrements it. If its > 0, the GC never happens.
I saw the FPS boost only in some scenes, I think they used an old AtomTimeline plugin and in scenes that use the native VaM animation playback.
However I always reenabled the GC after every LateUpdate() call happened, which put the GC somewhere while the rendering happens, so there WAS some GC happening, I never reached 27gb of ram. But to me it looks like the GC happened less frequently somehow and like it skipped some things.
You actually want the GC to happen sometime, since it decreases the future allocation time, but you dont want it to happen at critical single threaded bottlenecks like it can happen in default. A long garbage collection while physics is running will cause a stutter. A long garbage collection while the CPU is waiting for the GPU to finish rendering is not noticeable.
 
Last edited:
Hi. Did some more testing with HT on and off. Getting similar results as trety.
HT OFF
Benchmark-20240217-233808 1080 NO HT.png

HT ON
Benchmark-20240218-001934.png

So not much difference between HT on and off except as stated earlier that that. CPU runs cooler with HT off.
So all cool in desktop mode.
However what puzzles me is that VR performance is a bit eratic. Simple one person scene, anim some buttons. ~90fps on load. Then changing similar preset and FPS drop to ~40. Have to try with vanilla install to come to a conclusion though.
Laters
 
Hi. Did some more testing with HT on and off. Getting similar results as trety.
HT OFF
View attachment 336384
HT ON
View attachment 336385
So not much difference between HT on and off except as stated earlier that that. CPU runs cooler with HT off.
So all cool in desktop mode.
However what puzzles me is that VR performance is a bit eratic. Simple one person scene, anim some buttons. ~90fps on load. Then changing similar preset and FPS drop to ~40. Have to try with vanilla install to come to a conclusion though.
Laters
could be motion smoothing. If you drop from 91fps to 89fps rendering fps, the displayed fps drops from 90 to 45 fps.
 
Huh, there is an "Only physical core" option in tarkov it seems, exactly what I also discovered by messing around.


This will improve FPS, but will make GC stutters very long

not available in current unity version
Edit: it's not documented but does change things, job-worker-count=6 worked best for my 5950x where I use 8 cores for vam.

had no effect

lowers fps

Yeah, had similar results in my testing. I did find some glitches.
Everything else worked fine, but adding gfx-enable-gfx-jobs=1 glitches out fog and smoke (Xstatic fog and Hazmhox smoke) with flickering.
Unfortunately, that's the line which gives the most performance gain as well.
 
could be motion smoothing. If you drop from 91fps to 89fps rendering fps, the displayed fps drops from 90 to 45 fps.
Thanks so much for mentioning this comment as it forced me to go and double-check my Vive Pro 2 settings where I saw that while 'Motion compensation' was switched off, there was another option, 'FPS Preference', that was set to 'Auto' with selectable options for 'Disable', '1/2', or '1/3'. When I switched it to 'Disable' and then fired up some of my most demanding scenes in VAM VR that previously brought me down to ~40fps on a 14900k/4090 combo with 64 GB of RAM, I now found my framerates in the 90-120fps range depending on various physics settings. I have NEVER been able to run VAM like this and everything is MUCH smoother now. Additionally, I'm not entirely sure which of your updates resulted in the most FPS gain as I haven't run the VR benchmarks yet, but I'm thankful for what I have now. As I haven't seen any other 14900k users give their settings (even though I know that 13900k is basically the same chip), here's what I'm using right now, do you think I need to make any adjustments for (even) better performance?

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=4
skinmeshPart=1
applyMorphs=2
skinmeshPartMaxPerChar=4
applyMorphMaxPerChar=2
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0
 
Thanks so much for mentioning this comment as it forced me to go and double-check my Vive Pro 2 settings where I saw that while 'Motion compensation' was switched off, there was another option, 'FPS Preference', that was set to 'Auto' with selectable options for 'Disable', '1/2', or '1/3'. When I switched it to 'Disable' and then fired up some of my most demanding scenes in VAM VR that previously brought me down to ~40fps on a 14900k/4090 combo with 64 GB of RAM, I now found my framerates in the 90-120fps range depending on various physics settings. I have NEVER been able to run VAM like this and everything is MUCH smoother now. Additionally, I'm not entirely sure which of your updates resulted in the most FPS gain as I haven't run the VR benchmarks yet, but I'm thankful for what I have now. As I haven't seen any other 14900k users give their settings (even though I know that 13900k is basically the same chip), here's what I'm using right now, do you think I need to make any adjustments for (even) better performance?

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=4
skinmeshPart=1
applyMorphs=2
skinmeshPartMaxPerChar=4
applyMorphMaxPerChar=2
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0
settings are fine, but I would suggest to set the same non-vr settings in vr and use processlasso to put the non-vam processes onto the efficiency cores (steamvr, oculus, whatever you use)
 
Works great on desktop, but no increase in VR. Running into the same issues as @wanderer

Using a 4090, i9 13900. On Desktop it's pretty good, getting almost 30+fps!
In VR however, there's no performance increase, it's almost the same. (Quest 3 with VD, no asw/ssw/vsync/motion smoothing on)
Messed around in the ini settings too, but in VR it all just seems the same. Tried to copy the same for threads to threadsVR, then lowered the threadsVR even more, but all the same:

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0

Also adjusted the boot.config. Would love for this to work in VR too if anyone had any success on a 13900/14900!

Edit 2:
Tried using Process Lasso and setting vam.exe to P cores and everything else to E cores, still the same no increase in VR performance. Tried with Oculus runtime and SteamVR, same deal
 
Last edited:
Works great on desktop, but no increase in VR. Running into the same issues as @wanderer

Using a 4090, i9 13900. On Desktop it's pretty good, getting almost 30+fps!
In VR however, there's no performance increase, it's almost the same. (Quest 3 with VD, no asw/ssw/vsync/motion smoothing on)
Messed around in the ini settings too, but in VR it all just seems the same. Tried to copy the same for threads to threadsVR, then lowered the threadsVR even more, but all the same:

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0

Also adjusted the boot.config. Would love for this to work in VR too if anyone had any success on a 13900/14900!

Edit 2:
Tried using Process Lasso and setting vam.exe to P cores and everything else to E cores, still the same no increase in VR performance. Tried with Oculus runtime and SteamVR, same deal
set affinity=1,2,3,4,5,6,7,8

Works great on desktop, but no increase in VR. Running into the same issues as @wanderer

Using a 4090, i9 13900. On Desktop it's pretty good, getting almost 30+fps!
In VR however, there's no performance increase, it's almost the same. (Quest 3 with VD, no asw/ssw/vsync/motion smoothing on)
Messed around in the ini settings too, but in VR it all just seems the same. Tried to copy the same for threads to threadsVR, then lowered the threadsVR even more, but all the same:

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0

Also adjusted the boot.config. Would love for this to work in VR too if anyone had any success on a 13900/14900!

Edit 2:
Tried using Process Lasso and setting vam.exe to P cores and everything else to E cores, still the same no increase in VR performance. Tried with Oculus runtime and SteamVR, same deal
try to close HT,set affinity=1,2,3,4,5,6,7,8
 
Works great on desktop, but no increase in VR. Running into the same issues as @wanderer

Using a 4090, i9 13900. On Desktop it's pretty good, getting almost 30+fps!
In VR however, there's no performance increase, it's almost the same. (Quest 3 with VD, no asw/ssw/vsync/motion smoothing on)
Messed around in the ini settings too, but in VR it all just seems the same. Tried to copy the same for threads to threadsVR, then lowered the threadsVR even more, but all the same:

[threads]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[threadsVR]
computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15

[profiler]
enabled=0

Also adjusted the boot.config. Would love for this to work in VR too if anyone had any success on a 13900/14900!

Edit 2:
Tried using Process Lasso and setting vam.exe to P cores and everything else to E cores, still the same no increase in VR performance. Tried with Oculus runtime and SteamVR, same deal
What about setting Always Disable Asynchronous Spacewarp?
 
try to close HT,set affinity=1,2,3,4,5,6,7,8
Just tried turning off Hyper threading, and setting affinity to 1,2,3,4,5,6,7,8.
No dice in VR, same performance with and without. Any other ideas? ?

What about setting Always Disable Asynchronous Spacewarp?
1708248603944.png


ASW = Asynchronous Spacewarp

They're all disabled like I mentioned.
 
very like your plug! hope more improve to intel core and VR mode.

and:
Currently, VAM has a major issue which is the slow loading speed. It's not the speed of entering the game, but the loading of scenes, skin textures, characters and other presets. There are currently two solutions to this problem: 1) VAM has a caching mechanism. For example, when a character has been loaded, their skin will be cached in the cache folder, which will speed up the process the next time it's opened, but the speed is still quite slow, taking about 5 seconds. 2) When already in the game, opening the same clothing preset or skin preset twice will be much faster because the content has already been loaded into memory the first time. Loading from memory is significantly faster, taking about 1 second.

I hope that you, as the developer, can solve this loading speed issue. For example, by decompressing and storing commonly used content in memory before starting the game, we can achieve instant loading the next time the game is opened. ? @turtlebackgoofy
 
very like your plug! hope more improve to intel core and VR mode.

and:
Currently, VAM has a major issue which is the slow loading speed. It's not the speed of entering the game, but the loading of scenes, skin textures, characters and other presets. There are currently two solutions to this problem: 1) VAM has a caching mechanism. For example, when a character has been loaded, their skin will be cached in the cache folder, which will speed up the process the next time it's opened, but the speed is still quite slow, taking about 5 seconds. 2) When already in the game, opening the same clothing preset or skin preset twice will be much faster because the content has already been loaded into memory the first time. Loading from memory is significantly faster, taking about 1 second.

I hope that you, as the developer, can solve this loading speed issue. For example, by decompressing and storing commonly used content in memory before starting the game, we can achieve instant loading the next time the game is opened. ? @turtlebackgoofy
Give a shot to forcepersoncache plugin by @JayJayWon, it makes the 1st person atom to load in faster for the cost of a little bit more loading time for vam. loading scenes becomes a bit faster especially if the scene contains 1 person as this plugin is for 1 person atom only. Its solely is for person atom excluding its textures skins etc.
 
very like your plug! hope more improve to intel core and VR mode.

and:
Currently, VAM has a major issue which is the slow loading speed. It's not the speed of entering the game, but the loading of scenes, skin textures, characters and other presets. There are currently two solutions to this problem: 1) VAM has a caching mechanism. For example, when a character has been loaded, their skin will be cached in the cache folder, which will speed up the process the next time it's opened, but the speed is still quite slow, taking about 5 seconds. 2) When already in the game, opening the same clothing preset or skin preset twice will be much faster because the content has already been loaded into memory the first time. Loading from memory is significantly faster, taking about 1 second.

I hope that you, as the developer, can solve this loading speed issue. For example, by decompressing and storing commonly used content in memory before starting the game, we can achieve instant loading the next time the game is opened. ? @turtlebackgoofy
I use this: https://github.com/sFisherE/vam_plugin_release/tree/main
 
Just tried turning off Hyper threading, and setting affinity to 1,2,3,4,5,6,7,8.
No dice in VR, same performance with and without. Any other ideas? ?


View attachment 336513

ASW = Asynchronous Spacewarp

They're all disabled like I mentioned.

Make sure you're not GPU limited. I noticed that VD encoding is pretty GPU demanding, even for 4090.
The easiest way to check that is to lower the render resolution inside VAM (from 1.0 to 0.75) and see if you're getting more fps. If you're then 4090 is too weak.
That's why I switched VD from Godlike preset to the lower one.
 
Easier and more automated is to use Process Lasso with the following rules:
CPU affinity rule for vam:
View attachment 334188
Default affinity rule (when vam is not running):
View attachment 334190
Auto profile switcher rule (so when vam starts it will apply the affinity as above, when you close it then it will rollback changes):
View attachment 334189
So cool, thank you for sharing these!
Easier and more automated is to use Process Lasso with the following rules:
CPU affinity rule for vam:
View attachment 334188
Default affinity rule (when vam is not running):
View attachment 334190
Auto profile switcher rule (so when vam starts it will apply the affinity as above, when you close it then it will rollback changes):
View attachment 334189
Intel 13900K/13800K/13700K
(we are using the performance cores only)

computeColliders=8
skinmeshPart=8
applyMorphs=8
skinmeshPartMaxPerChar=8
applyMorphMaxPerChar=8
affinity=1,3,5,7,9,11,13,15


Using 13900k, just to confirm, that Process Lasso and this performance patch are reporting i9 performance cores with different numbers: 0,2,4,6,8,10,12,14 vs. 1,3,5,7,9,11,13,15.

So I guess that's ok then, right? :)
 
Back
Top Bottom