Below are the results from running this on my 2011 MacBook Pro with an Intel Core i7-2635QM CPU @ 2.00GHz.
$ make compare
time ./by-ref
7.07 real 7.05 user 0.00 sys
time ./by-value
7.78 real 7.76 user 0.00 sys
$ make compare
time ./by-ref
2.55 real 2.54 user 0.00 sys
time ./by-value
4.87 real 4.86 user 0.00 sys
make compare
time ./by-ref
1.79 real 1.78 user 0.00 sys
time ./by-value
1.65 real 1.65 user 0.00 sys
make compare
time ./by-ref
1.77 real 1.76 user 0.00 sys
time ./by-value
1.66 real 1.66 user 0.00 sys