performance optimizations

This commit is contained in:
in0finite 2022-01-23 21:45:40 +01:00
parent 5cea14c46e
commit b2e6ed7467

View file

@ -258,7 +258,7 @@ namespace SanAndreasUnity.Editor
currentObject.GetComponentOrThrow<MapObject>().Show(1f);
if (i % 50 == 0)
if (i % 100 == 0)
{
// wait for completion of jobs
@ -340,7 +340,9 @@ namespace SanAndreasUnity.Editor
float diffPerc = endPerc - startPerc;
long initialNumPendingJobs = LoadingThread.Singleton.GetNumJobsPending();
yield return null; // this must be done, otherwise LoadingThread does not start processing any job
long numPendingJobs;
do
{
@ -356,7 +358,7 @@ namespace SanAndreasUnity.Editor
yield break;
}
yield return null;
System.Threading.Thread.Sleep(10); // don't interact with background thread too often, and also reduce CPU usage
} while (numPendingJobs > 0);