AsyncWorker now manually triggers GC at the end of each task run, similar to the main thread

this avoids costly GC runs during hot code.
This commit is contained in:
Dylan K. Taylor
2024-12-15 21:25:32 +00:00
parent 8f536e6f21
commit 42f90e94ff
5 changed files with 121 additions and 47 deletions

View File

@ -82,7 +82,11 @@ class RakLibServer extends Thread{
}
protected function onRun() : void{
//TODO: switch to manually triggered GC
//the best time to do it is between ticks when the server would otherwise be sleeping, but RakLib's current
//design doesn't allow this as of 1.1.1
gc_enable();
ini_set("display_errors", '1');
ini_set("display_startup_errors", '1');
\GlobalLogger::set($this->logger);