Carbon -
Fast Ruby -
Code Runner -

DISCLAIMER: Not all "faster" methods may be a direct replacement as the functionality could be different. Be sure to do your own testing to see if there are benefits for your specific use cases.
Download Source Code


# benchmark.rb
require 'benchmark/ips'

n = 500_000
Benchmark.ips do |x|'for') { for i in 1..n; a = '1'; end }'times') { n.times do; a = '1'; end }'upto') { 1.upto(n) do; a = '1'; end }!