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

Adds a style for freezing string literals #15

Merged
merged 1 commit into from Oct 18, 2018

Conversation

sarcas
Copy link
Contributor

@sarcas sarcas commented Sep 19, 2018

Since Ruby 2.3, Ruby has had a MagicComment that can be added to the top of files. This makes all string literals frozen by default. This is a memory optimization; as the virtual machine doesn't allocate as many strings, it doesn't need to do as much garbage collection.

See: https://www.mikeperham.com/2018/02/28/ruby-optimization-with-one-magic-comment for an example discussion, and http://ruby-performance-book.com/blog/2016/02/is-ruby-2-3-faster-frozen-string-literals-performance.html for another view

Before merging this, we need to decide if we want to do this as a team.

Note: RFD in progress

 Since Ruby 2.3, Ruby has had a MagicComment that can be added to the top of files. This makes all string literals frozen by default. This is a memory optimization; as the virtual machine doesn't allocate as many strings, it doesn't need to do as much garbage collection.

See: https://www.mikeperham.com/2018/02/28/ruby-optimization-with-one-magic-comment for an example discussion, and http://ruby-performance-book.com/blog/2016/02/is-ruby-2-3-faster-frozen-string-literals-performance.html for another view

Before merging this, we need to decide if we want to do this as a team.

Note: [RFD in progress](https://docs.google.com/document/d/10Gt9BlxUbWE09-dTY21qpUARKpk8jrHYrLnDM_6nzCc)
@sarcas
Copy link
Contributor Author

sarcas commented Oct 8, 2018

@lylo are you happy for me to merge this branch down?

@lylo
Copy link
Contributor

lylo commented Oct 9, 2018

@sarcas I don't think I need to sign these things off, probably not the best person these days! if there is team consensus it's fine by me

@sarcas sarcas merged commit 34ef95e into master Oct 18, 2018
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.

None yet

2 participants