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

Reduce allocations for NavMap synchronization #98866

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Nov 5, 2024

Improves navigation map sync performance by avoiding unnecessary memory allocations.

  • Edges were still using old CoW Vectors.
  • Map sync was creating new HashMaps / LocalVectors for every build data instead of reusing.

In a large test project this change dropped the sync time from ~400.000 usec down to ~300.000 usec.
Roughly a 20-30% improvement on average in the projects I tried.

Improves navigation map sync performance be avoiding unnecessary memory allocations.
@smix8 smix8 added this to the 4.4 milestone Nov 5, 2024
@smix8 smix8 requested a review from a team as a code owner November 5, 2024 21:49
@Repiteo Repiteo merged commit 95780d8 into godotengine:master Nov 10, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 10, 2024

Thanks!

@smix8 smix8 deleted the navmap_allocation branch November 11, 2024 18:45
@smix8 smix8 mentioned this pull request Dec 24, 2024
25 tasks
@akien-mga akien-mga changed the title Reduce allocations for NavMap synchronisation Reduce allocations for NavMap synchronization Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants