mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Stop running shrinking gcs & simplify GC logic.
Shrinking GCs dump the JITted code, which leads to redundant recompilations, lowers performance, and makes profiling JS more difficult. They may still happen if the runtime is at risk of OOM.
This commit is contained in:
committed by
wraitii
parent
d262eb8757
commit
af32d386b9
@@ -43,6 +43,7 @@
|
||||
#include "renderer/TimeManager.h"
|
||||
#include "renderer/WaterManager.h"
|
||||
#include "scriptinterface/FunctionWrapper.h"
|
||||
#include "scriptinterface/ScriptContext.h"
|
||||
#include "scriptinterface/ScriptInterface.h"
|
||||
#include "scriptinterface/JSON.h"
|
||||
#include "simulation2/Simulation2.h"
|
||||
@@ -331,6 +332,11 @@ PSRETURN CGame::ReallyStartGame()
|
||||
// all be invisible)
|
||||
Interpolate(0, 0);
|
||||
|
||||
// Run a shrinking GC to reset the memory before starting the game proper.
|
||||
// This also clears JIT code, which seems like a good idea as the game init
|
||||
// might have different patterns to the game itself.
|
||||
m_Simulation2->GetScriptInterface().GetContext().ShrinkingGC();
|
||||
|
||||
m_GameStarted = true;
|
||||
|
||||
// Preload resources to avoid blinking on a first game frame.
|
||||
|
||||
Reference in New Issue
Block a user