Sha256: b1c56a8be4a218ce9914a9348bd446e4b07a8eb9177d4d4363e3eb1a5ca9f195
Contents?: true
Size: 417 Bytes
Versions: 26
Compression:
Stored size: 417 Bytes
Contents
#!/usr/bin/env ruby # frozen_string_literal: true require 'benchmark/ips' def str 'http://baruco.org/2014/some-talk-with-some-amount-of-value' end Benchmark.ips do |x| x.report('#tr') { str.tr('some', 'a') } x.report('#gsub') { str.gsub('some', 'a') } x.report('#gsub!') { str.gsub!('some', 'a') } x.report('#sub') { str.sub('some', 'a') } x.report('#sub!') { str.sub!('some', 'a') } end
Version data entries
26 entries across 26 versions & 1 rubygems