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

use stringer/strcat instead of str for all of our string composition #7730

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

Conversation

NBKelly
Copy link
Collaborator

@NBKelly NBKelly commented Sep 14, 2024

I went through (almost) every backend class to do this.
Essentially, java is sloppy and slow with string operations using the basic libraries, and clojure inherits this. Stringer is a bit more optimized, so this is basically a "free" speedup (do note that the compile time will be a little longer, but we don't care too much about that).

@NoahTheDuke
Copy link
Collaborator

This is a pretty aggressive change. Do you have any reason to believe that java's native StringBuilder is causing us slowness?

@NBKelly
Copy link
Collaborator Author

NBKelly commented Sep 14, 2024

This change is admittedly based more on intuition than anything provable, I just figure string operations are actually sorta expensive and we use them a lot. At best this is going to be a super marginal improvement though, and if it's not worth that then no worries with rejecting this.

I figure since (looking at the server holdups) they're mostly a single thread with a super high stack depth thrashing, if we can minimize that a little bit, we're coming up ahead.

I could easily be wrong though, and this could be not a good idea after all 🤔.

@NoahTheDuke
Copy link
Collaborator

If you can point to something specific, like usage in the flame graph or an actual speed improvement in a performance test, then i'd be willing to try this out. otherwise, is an extra dependency for negligible improvements, when we could fix sending 50mb of lobby updates to 30 people every minute lol.

@NBKelly
Copy link
Collaborator Author

NBKelly commented Sep 14, 2024

fair 😂

@NBKelly NBKelly marked this pull request as draft September 14, 2024 01:50
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