11 ms·
It's too bad that Ruby requires strings to be GC-ed, otherwise you could get away with an even faster stack string up to a certain size. Basically you would do
by dblock 15y ago
It's too bad that Ruby requires strings to be GC-ed, otherwise you could get away with an even faster stack string up to a certain size. Basically you would do the same thing as RString, but when you declare a string on the stack, there's no malloc unless you need >N chars.
https://github.com/dblock/baseclasses/tree/master/String https://github.com/dblock/baseclasses/tree/master/String for an implementation (a bit thick).