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

Optimization: Use static string concatenation instead of repetitive StringBuilder.append where appropriate. #100127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ivorforce
Copy link
Contributor

@Ivorforce Ivorforce commented Dec 6, 2024

I ran across this while testing StringBuilder efficiency (#77158 (comment)). append, especially for StringBuilder, is most effective when used with few, long strings.

This will likely not have a noticeable effect, but it will be slightly faster than before.

@Ivorforce Ivorforce requested a review from a team as a code owner December 6, 2024 23:03
@Ivorforce Ivorforce changed the title Use static string concatenation instead of repetitive StringBuilder.append where appropriate. Optimization: Use static string concatenation instead of repetitive StringBuilder.append where appropriate. Dec 6, 2024
@Ivorforce Ivorforce marked this pull request as draft December 6, 2024 23:06
@dsnopek
Copy link
Contributor

dsnopek commented Dec 6, 2024

Thanks! This makes sense to me

(I may be responsible for adding like ~50% of those lines: all the multiview and external image ones - sorry :-))

@Ivorforce Ivorforce force-pushed the string-builder-append branch from f663758 to 1fa1554 Compare December 6, 2024 23:16
@Ivorforce
Copy link
Contributor Author

No worries, it's not likely to make a big difference 😄

@Ivorforce Ivorforce marked this pull request as ready for review December 6, 2024 23:17
@Ivorforce Ivorforce requested a review from a team as a code owner December 6, 2024 23:17
@dsnopek
Copy link
Contributor

dsnopek commented Dec 6, 2024

Are the glslang changes worth doing? That's all third-party, so you'll need to include a patch, and those changes will need to be re-applied every time it's updated.

@Ivorforce Ivorforce force-pushed the string-builder-append branch from 1fa1554 to 5d3f9aa Compare December 6, 2024 23:22
@Ivorforce
Copy link
Contributor Author

Ivorforce commented Dec 6, 2024

Are the glslang changes worth doing? That's all third-party, so you'll need to include a patch, and those changes will need to be re-applied every time it's updated.

Nope, definitely isn't worth doing! I just missed that it was in thirdparty, thanks!
I think what we have now is all, then.

Copy link
Contributor

@kiroxas kiroxas left a comment

Choose a reason for hiding this comment

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

Definitely leave that to the compiler.

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