Perhaps your machine is more deterministic than mine, but successive
runs of that benchmark (and using #bmbm to be safer about the
measurement) sometimes show ‘a’ faster than “a”, sometimes slower.

The thing is they are rigourosly equivalents. As soon as the program
is parsed, they are represented exactly as the same objects, a String.
So they are the same, that’s why you get around the same processing
times.

Moreover, it is normal that interpolation is faster, because it
involves only evaluation of x as a String and string copy, whereas
addition involves two method calls (+ and +), which are rather expensive
(at least more than a string copy for such small strings).

Excellent, thanks. I started to benchmark my quiz submission’s file
reading and uh, ram usage on the ruby process skyrocketed to 200MB. Does
benchmark not play well with blocks of code?

So I tried to benchmark my code, and it works for very small numbers of
tests.
2 repetitions:
user system total real
0.871000 0.010000 0.881000 ( 0.902000)
5 repetitions:
user system total real
2.323000 0.050000 2.373000 ( 3.024000)
15 repetitions however gives the same problem - 5 minutes after I
started
the program I killed it.

Can someone help me understand if this is a problem with benchmark or
with
my code?