Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ext/digest: faster code. (merged from CRuby)
ruby/ruby@69f1e595 Test Script: ---- require 'benchmark' Benchmark.bm(10) do |x| x.report "before" do 10000.times do ipad = Array.new(1000).fill(0x36) ipad.inject('') { |s, c| s << c.chr }.freeze end end x.report "after" do 10000.times do ipad = Array.new(1000, 0x36) ipad.pack('C*').freeze end end end ---- user system total real before 15.220000 0.320000 15.540000 ( 13.063469) after 0.460000 0.010000 0.470000 ( 0.453947)
- Loading branch information