map-reduce looks fine here, yes, unless you have dozillions of
items, all having short (to be precise: shorter, than 23 bytes)
In that case
map to message (when
RValue size) will increase amount of Ruby Heaps, which are not GC’ed (read: memory is never returned back to OS.)
My point is: one should not abuse languages by using wrong paradigms, even if the latter is fancy, fashioned and has all the hype around. Ruby is ruby, and mutating a string here is the right approach. Even if it sounds COBOL-like solution.