From 66d15dc2156cb5f1e7c8ac53c1850b4a07c8d964 Mon Sep 17 00:00:00 2001 From: Marrub Date: Sat, 10 Feb 2018 18:28:53 +0000 Subject: [PATCH] Make the ACS string pool reserve more strings Due to only reserving a single new string when growing the string pool, any ACS code that generates lots of strings will eventually cause massive amounts of lag, to the point where ACSStringPool takes up *most of the execution time*. The proposed change fixes this issue. --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index e36cecde78..1b6c472d80 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -1284,7 +1284,7 @@ int ACSStringPool::InsertString(FString &str, unsigned int h, unsigned int bucke } if (index == Pool.Size()) { // There were no free entries; make a new one. - Pool.Reserve(1); + Pool.Reserve(MIN_GC_SIZE); FirstFreeEntry++; } else