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

Change navigation map performance monitor to use a struct #99626

Merged
merged 1 commit into from
Nov 26, 2024

Conversation

smix8
Copy link
Contributor

@smix8 smix8 commented Nov 24, 2024

Changes navigation map performance monitor to use a struct as it is easier to pass to sub functions.

It is impossible to split that giant map sync function with so many properties that would need to be passed to sub functions individually.

Changes navigation map performance monitor to use a struct as it is easier to pass to sub functions.
@smix8 smix8 added this to the 4.4 milestone Nov 24, 2024
@smix8 smix8 requested a review from a team as a code owner November 24, 2024 12:38
@@ -298,6 +298,19 @@ class Heap {
}
}
};

struct PerformanceData {
int pm_region_count = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the struct is called "performance_data" why are all members still prefixed with pm, which I assume means "performance"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the prefix originally removed but reverted and added it back in. Without that prefix it turns the code readability into a shitshow when you dont have a more sophisticated IDE as your mental crutch available. There are so many similar temp variables all over the place in sub functions that can be easily confused and the pm_ prefix makes it very clear what is what.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @Mickeon - as the fields are always prefixed with [name]. it's possible to have good readability without that pm_ prefix

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me.

@Repiteo Repiteo merged commit 78b2a53 into godotengine:master Nov 26, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 26, 2024

Thanks!

@smix8 smix8 deleted the performance_data branch November 26, 2024 20:34
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.

5 participants