Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved IsFileValid being very slow in huge scenes #54

Merged
merged 1 commit into from
Feb 14, 2024

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.

None yet

2 participants