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

Optimize configuration loading: cache JSON #218

Merged
merged 3 commits into from
Mar 3, 2025
Merged

Conversation

alternativshik
Copy link
Contributor

  • Moved environment variable parsing to a dedicated loadConfig() function, called only once during initialization of the global g_jsonConfig.
  • Updated GetJson() to return the cached JSON object, preventing repetitive parsing of environment variables on each access.
  • Improved performance and simplified configuration data access.

Replace <stdio.h> with and

  • Updated include directives to use modern C++ headers.
  • The new headers place standard library functions in the std namespace, enhancing compatibility and type safety as recommended by modern C++ standards.

- Moved environment variable parsing to a dedicated loadConfig() function, called only once during initialization of the global g_jsonConfig.
- Updated GetJson() to return the cached JSON object, preventing repetitive parsing of environment variables on each access.
- Improved performance and simplified configuration data access.

Replace <stdio.h> with <cstdlib> and <cstdio>

- Updated include directives to use modern C++ headers.
- The new headers place standard library functions in the std namespace, enhancing compatibility and type safety as recommended by modern C++ standards.
@alternativshik
Copy link
Contributor Author

Oh, see the almost same fixes in another PR

@daijro
Copy link
Owner

daijro commented Mar 3, 2025

Thanks for the PR, I'll try to merge what I can from the conflict 👍

@daijro daijro merged commit bbec766 into daijro:main Mar 3, 2025
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