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 game_namespace string concatenation and avoid copies #506

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

vittorioromeo
Copy link
Contributor

@vittorioromeo vittorioromeo commented Aug 23, 2022

Untested, similarly to #505. I just found another function that's frequently called and that's doing more work than it should. Might not matter for performance at all, or might reduce CPU usage slightly due to the avoidance of copies and dynamic string allocations.

I am not sure if thread_local is required, but I added it just to be safe. I also think it should be safe to change the return type to std::string& as in the PR, but that should be double-checked as well.

@praydog
Copy link
Owner

praydog commented Sep 6, 2022

Again did some tests in Rise and RE2 in and out of VR, works perfectly fine, thanks!

@praydog praydog merged commit 7639fd7 into praydog:master Sep 6, 2022
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