-
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
A potential performance improvement to rankEdgeCollapses #714
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 reverts commit 14223b7.
This change passes the tests, locally. I have observed that making these changes reduces the load time of meshes in Godot by ~60 to 75% Tests in Godot were done with several .glb files from official Godot test projects as well as randomly assorted files I had available. I freely admit I don't understand why this would make such a large difference. I originally had a huge set of changes put together in my copy of the Godot source, in this file, attempting to inline large amounts of calculations in the quadricError functions. I found this change entirely by accident. (And originally had it completely wrong, rewriting over the same reference for each iteration of this loop)
Let me know what sort of proof you would like for the performance changes. |
Please include detailed profiling methodology - what platform have you built Godot on, what compiler are you using, what compilation options are you using, and how exactly you are measuring the time. I ran this change on gcc/linux using meshoptimizer's demo program (edit and, forgot to mention, I see no difference in performance on the demo program, as should be expected); you can do the same by building it via make or CMake and running demo/main with flags
|
Op removed a line in his testing. https://i.imgur.com/Rgi475N.png |
WOAH! Thanks |
I must need some sleep. Collapse doesnt have a distance_error data member... |
Ah I see. Godot adds I would not recommend trying to optimize |
Once again, I really appreciate your time on this. Thank you very much. |
This change passes the tests, locally. I have observed that making these changes reduces the load time of meshes in Godot by ~60 to 75%
Tests in Godot were done with several .glb files from official Godot test projects as well as randomly assorted files I had available.
I freely admit I don't understand why this would make such a large difference. I originally had a huge set of changes put together in my copy of the Godot source, in this file, attempting to inline large amounts of calculations in the quadricError functions.
I found this change entirely by accident. (And originally had it completely wrong, rewriting over the same reference for each iteration of this loop)