Fixed the function IsFileValid, which was very slow on huge scenes (200MB). Please merge.
A simple measurement of the execution time with the following code showed that the time was reduced from 150s to 1s.
private static bool OnClickLoadPrefix(List<string> ___listPath, int ___select)
{
var path = ___listPath[___select];
System.DateTime begin = System.DateTime.Now;
bool ok = IsFileValid(path);
System.DateTime end = System.DateTime.Now;
Logger.LogDebug($"@@@ {(end - begin).TotalSeconds}");
return ok;
}
This incident was a lesson to me that it is not good to copy easily from stackoverflow.
By the way, KMPSearch copied from ChatGPT after a little testing.
Fixed the function IsFileValid, which was very slow on huge scenes (200MB). Please merge.
A simple measurement of the execution time with the following code showed that the time was reduced from 150s to 1s.
This incident was a lesson to me that it is not good to copy easily from stackoverflow. By the way, KMPSearch copied from ChatGPT after a little testing.