Between immutability and memoization, you might have to choose

It is not always possible to have frozen AND performant objects in Ruby.

Read in full here: