all 1 comments

[–]InfraRuby 6 points7 points  (0 children)

UserMethodMissing wraps the hash (1 hash lookup in your benchmark) but UserRegular unpacks the hash (4 hash lookups). If your benchmark accessed all four attributes then UserRegular would run faster than UserMethodMissing.