4 ms·
Ruby string processing is faster than Python due to Ruby's built-in regular expressions. Numeric computation is generally faster in Python though Ruby does have
by cutler 9y ago
Ruby string processing is faster than Python due to Ruby's built-in regular expressions. Numeric computation is generally faster in Python though Ruby does have some shortcuts which make it faster for certain types of calculation. I think these are due to memoisation.