-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Improve NavMeshGenerator2D::generator_bake_from_source_geometry_data
performance
#98957
Conversation
Agree that the 2d baking could be improved and some of the changes here look fine. |
We can probably get away with it with some getter returning const references. They exist (at least two of them) but they look wrong to me : |
9238456
to
4d20d2f
Compare
So the performance is roughly the same with the getters, so I made the change. Only the function is changed now. |
c7a6af7
to
08f353b
Compare
As suggested by smix8, I took the friend path instead of public. |
87f824c
to
88ce90e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested a few projects and bakes fine without any noticeable error.
Still needs a code review.
88ce90e
to
78ec9dd
Compare
…` performance Avoid copies and redundant work.
78ec9dd
to
07b7f76
Compare
Just pushed an amend to edit the commit message to match the PR title and be more explicit. |
Thanks! Congratulations on your first contribution! 🎉 |
Removed a lot of unecessary copies and duplicated work in
NavMeshGenerator2D::generator_bake_from_source_geometry_data
.Tested on all godot examples project 2D Navigation. (navigation, navigation_astar, navigation_mesh_chunks)
Reduced navmesh creation for the chunk project from 34 000 000 cycles to 17 000 000 cycles on average. (mesured with RDTSC)
So roughly a 2x speed up.