1
0
mirror of https://github.com/soarqin/DSP_Mods.git synced 2025-12-09 00:13:36 +08:00

update README

This commit is contained in:
2023-09-02 14:30:43 +08:00
parent cd9a85c693
commit 0ddcdb1eac
4 changed files with 10 additions and 3 deletions

View File

@@ -273,7 +273,6 @@ public class PoolOptPatch : BaseUnityPlugin
return true;
}
Logger.LogDebug($"Old size = {cursor}. Old recycle size = {recycleCursor}");
cursor = pos + 1;
Array.Sort(recycle, 0, recycleCursor);
var idx = Array.BinarySearch(recycle, 0, recycleCursor, pos + 1);

View File

@@ -5,7 +5,7 @@
<AssemblyName>PoolOpt</AssemblyName>
<BepInExPluginGuid>org.soardev.poolopt</BepInExPluginGuid>
<Description>DSP MOD - PoolOpt</Description>
<Version>0.1.0</Version>
<Version>0.9.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

View File

@@ -3,6 +3,10 @@
#### Optimize memory pools on loading gamesaves
#### 加载游戏存档时优化内存池的使用
# Notes
* Does not optimize some rarely uses pools, mostly UI related.
* Does not optimize solar sails' pool, please use button on dyson sphere panel from original game to clean it up.
# Mechanism
* The game uses a lot of memory pools in array to store data, sizes and capacities of these pools are increased on demand but never decreased, even most data inside are not used due to dismantle objects. Unused slot IDs are save in recycle array for reuse.
* Some game functions loop through all allocated slots in the pool, so the size of the pool will affect the performance.
@@ -11,6 +15,10 @@
# TODO
* Remove the unused slots from middle of the pool, which leads to ID change for stored objects, needs more investigation.
# 说明
* 不会优化一些很少使用的内存池主要是UI相关的。
* 不会优化太阳帆的内存池,请使用原版游戏中的戴森球面板上的按钮进行清理。
# 原理
* 游戏使用了大量的内存池数组来存储数据这些内存池的大小和容量是只会随需求膨胀不会收缩的即使由于拆除物体导致内部大多数数据不再使用。而未使用的槽位ID会被保存在回收数组中以供重复使用。
* 一些游戏功能会循环遍历内存池中的所有分配过的槽位,因此内存池的大小会影响性能。

View File

@@ -1,6 +1,6 @@
{
"name": "PoolOpt",
"version_number": "0.1.0",
"version_number": "0.9.0",
"website_url": "https://github.com/soarqin/DSP_Mods/tree/master/PoolOpt",
"description": "Optimize memory pools on loading gamesaves / 加载游戏存档时优化内存池的使用",
"dependencies": [