You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What language does this apply to?
Applies to ruby generated code
Describe the problem you are trying to solve.
In ruby, string literals are (unfortunately) mutable. This comes with a memory penalty. There is a magic comment you can use at the top of any ruby file to opt-out of this for the file only:
# frozen_string_literal: true
....
I think it would be cool if protoc output ruby in this manner, albeit mostly because this is a best practice. I'd be shocked if this had any real-world performance gains.
As far as I can tell, the protoc compiler never makes use of the theoretical mutability of ruby strings, as it ought not to. Therefore it should not even be an option; all compiled ruby should have mutable strings turned off.
Describe the solution you'd like
Every ruby compiled source file (*_pb.rb) should have the magic comment described above at the top.
Describe alternatives you've considered
N/A
Additional context
I'd be happy to do this if you guys agree :)
The text was updated successfully, but these errors were encountered:
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.
This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.
What language does this apply to?
Applies to ruby generated code
Describe the problem you are trying to solve.
In ruby, string literals are (unfortunately) mutable. This comes with a memory penalty. There is a magic comment you can use at the top of any ruby file to opt-out of this for the file only:
I think it would be cool if
protoc
output ruby in this manner, albeit mostly because this is a best practice. I'd be shocked if this had any real-world performance gains.As far as I can tell, the
protoc
compiler never makes use of the theoretical mutability of ruby strings, as it ought not to. Therefore it should not even be an option; all compiled ruby should have mutable strings turned off.Describe the solution you'd like
Every ruby compiled source file (
*_pb.rb
) should have the magic comment described above at the top.Describe alternatives you've considered
N/A
Additional context
I'd be happy to do this if you guys agree :)
The text was updated successfully, but these errors were encountered: