Preface: This is a joint work with Claude code. The patches here are all lua mods, and do not do anything on their own. They make different mods faster when used together.
After setting up the current mod list, I can only drive with 30fps and a lot of stutter, while i can drive max speed in 120fps vanilla (thanks to PZ optimization). I want to play the game, so I profile my save to find offenders. The fix turned out to be pretty effective, so I figured I share it here in case it helps anyone.
The collection can be found here: https://github.com/galaxy321/pz-optimization-mods. Hope this is useful to anyone who has issue with a lot of mods.
Some Technical Details For People Interested
Mods ask the engine to see if specific item/furniture exists every time a chunk is loaded. The query is rather expensive when it reaches java engine, and the cost adds up quickly for multiple mods. Driving fast compounds the issue as thousands of chunks are loaded each second. The patch merges all such queries into one, and only invoke corresponding handler if, for example, a generator or a gas pump is found in the chunk. My list contains 7 such mods, and the patch shaves the original 170ms/s query time to 30ms/s.
Another patch targets UI throttling to help with stutter. In vanilla, character inventory is rebuilt every time it reaches a new square, and this causes stuttering for me with mod like CleanUI. The throttle patch changes it to rebuild inventory only when new container/ground item appears, and also throttle the rebuild frequency when jogging/sprinting. The patch also skips rebuilding while you are driving, unless there's inventory action. This moves the corresponding time cost from 30ms/s to 8.3 ms/s. This is best paired with tuning down UI refresh frequency in the game options.
Some other minor fixes, and the profiler used to determine the hurting points, can also be found in the repository. In total this get me from 30fps driving with constant lag spikes to mostly smooth drivng with 60fps at max speed.