Josh Beckmanover-use of the memoization pattern can cause a degradation of performance in your Ruby programs, so it can be effective to eagerly initialize instance variables in the constructor to avoid this, at least in hot spots.
But if the pattern is used moderately, itās probably not a big deal and will be handled better by either YJIT or future versions of Ruby.
Jean BoussierPerformance Impact of the Memoization Idiom on Modern Ruby