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

Replace mVariables map by unordered map to optimize get functions #403

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

jeremy010203
Copy link
Contributor

mVariables is used to store config values as a simple dict.
There is no need to use a map as we don't need to keep track of insertion order of keys.
I propose to replace the map by unordered map.

On soh the getinteger function seems to be 2x faster (1,8% -> 0,9% of cpu usage):

Screenshot 2024-01-02 at 17 04 30 Screenshot 2024-01-02 at 17 04 04

Copy link
Owner

@Kenix3 Kenix3 left a comment

Choose a reason for hiding this comment

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

Good catch. I think this one got missed when we did the map -> unordered_map conversion.

@Kenix3 Kenix3 merged commit 0aa972b into Kenix3:main Jan 2, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants