Skip to content

Commit a3cac0d

Browse files
committed
Sneaky last minute performance gains
1 parent 88da1b9 commit a3cac0d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Source/Managers/LuaMan.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ void LuaStateWrapper::Initialize() {
3434
tracy::LuaRegister(m_State);
3535

3636
// Disable gc. We do this manually, so we can thread it to occur parallel with non-lua updates
37-
lua_gc(m_State, LUA_GCSTOP, 0);
37+
// Not doing this for now... see StartAsyncGarbageCollection()
38+
//lua_gc(m_State, LUA_GCSTOP, 0);
3839

3940
const luaL_Reg libsToLoad[] = {
4041
{LUA_COLIBNAME, luaopen_base},
@@ -1173,6 +1174,11 @@ void LuaMan::Update() {
11731174
void LuaMan::StartAsyncGarbageCollection() {
11741175
ZoneScoped;
11751176

1177+
// For now we're not doing this... because it's slower than normal (blocking) GC collection during the update
1178+
// This is because Lua is trash and basically GCSTEP is meaningless and can cause memory leak runaway, whereas GCCOLLECT is ultra-expensive
1179+
// So for now we do normal GC collection :(
1180+
return;
1181+
11761182
std::vector<LuaStateWrapper*> allStates;
11771183
allStates.reserve(m_ScriptStates.size() + 1);
11781184

0 commit comments

Comments
 (0)