-
Notifications
You must be signed in to change notification settings - Fork 480
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
Large perf improvement #713
Conversation
I was working in Godots main branch, trying to improve load times and made a ton of changes to this file. I ultimately found that this one small change accounted for 90% or more of my total improvements. In godot, loading a ~34 MB glb file went from 18 seconds to 4.9 seconds.
This completely breaks the simplifier since you no longer rank collapses. |
How so? I'm missing something about this function, then. Without my change: If we declare c above the for loop and simply change which item in the array it is referencing every iteration, what breaks? |
That is not how your code works. Your code change always references element 0 in the loop body. The assignment overwrites collapse 0 with collapse on each iteration, but the error on any other collapses is never updated. You would note that this change breaks the tests (https://github.com/zeux/meshoptimizer/actions/runs/9704155260/job/26783830103). |
I did see that test failing from the results of my pull request. Unfortunately I am failing on line 880 without any changes. I'll keep at it. |
And sorry. I didn't say thank you for enlightening me. I really appreciate it. I still have a lot to learn. So, out of curiosity I tried:
This appears to pass. I didn't want to spam you with another potentially terrible pull request. Do you see any issues here? |
This code looks correct but it should not be any faster. |
I agree. Unfortunately I am seeing a load time in Godot for a ~34 MB glb file go from: And I also don't see how. But I have tested it about a dozen times on two copies of the repo. |
I was working in Godots main branch, trying to improve load times and made a ton of changes to this file. I ultimately found that this one small change accounted for 90% or more of my total improvements. In godot, loading a ~34 MB glb file went from 18 seconds to 4.9 seconds.