Skip to content

Conversation

takahiro0327
Copy link
Contributor

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.

@ManlyMarco ManlyMarco merged commit d60f4e3 into IllusionMods:master Feb 14, 2024
@takahiro0327 takahiro0327 deleted the huge_scene branch February 16, 2024 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants