Performance: Cache compiled mods and in-game scripts
Game version: 1.200.030
Observation: Compiled mods and in-game scripts are not cached on disk.
It can be done relatively easily in MyScriptCompiler.Compile.
Please see files: MyScriptCompiler*.*
I'm pretty sure it is unreadable due to having to runtime patch an async method, but you get the idea for sure.
Compiling mods needs a bit more attention, because they need to register themselves. There is a Mod ID and some related administration. To be honest MyModWatchdog.AllocateModId is a quite unpleasant, non-deterministic solution. It almost prevented my caching attempt.
The Mod ID is used in some performance profiling injection as well (PerfCountingRewriter), which I had to disable to stabilize the compiled code. It could be fixed by storing a unique Mod ID in the cache, so they can be recalled. (I did not implement it this way, so careful!)
Single player world with 36 mods (with code) and 33 distinct in-game scripts loads ~33% faster.
World from a large multiplayer server (~500 grids) loads 18 seconds faster (original is 105 seconds).
Notes on the Dedicated Server
The Dedicated Server loads plugins too late, so I could no apply caching during world loading there. Please load plugins first, then mods and finally the world entities. It would allow fixing stuff there. It works with the client where plugins loaded quite early. Why shouldn't it work with the DS?