Skip to content

[Documentation/Wiki] FAQ entry about frozen strings? #6626

Answered by headius
rubyFeedback asked this question in Q&A
Discussion options

You must be logged in to vote

The frozen string directive will have the same effect on performance as it would in standard Ruby: less allocation of String objects.

Ruby Strings passed to Java calls are always converted into Java Strings, which are themselves immutable, so this doesn't really change anything about calling into Java. It may offer a possible performance improvement in the future if we cache the Java String object that corresponds to a given frozen literal String (but we are reluctant to fill memory with more String data than necessary).

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by headius
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #6625 on March 22, 2021 14:45.