-
Notifications
You must be signed in to change notification settings - Fork 137
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 string literals with symbols or frozen strings #37
Conversation
…ory allocation and freezing all remaining string literals
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Thanks for tackling this. Curious to see feedback from anyone at DataDog.
fyi @pengwynn who is probably curious about this work |
It's a good start @janester! I'm afraid that saving these allocations won't do much with the amount of |
Thank you for the improvement @janester ! |
Context
Ruby strings take up new spots of memory every time they are used. Generally it's not a problem but the memory adds up at scale. Symbols and frozen strings will always occupy the same spot in memory, which reduces the memory load and increases performance.
This Change
to_sym
-ed)@jnunemaker @aroben @vmg can you take a look at this and let me know what you think/if I'm missing something? 🙏 💖