nurse / strptime

a fast strptime engine
Other
38 stars 12 forks source link

Return localtime-based results #4

Closed mururu closed 9 years ago

mururu commented 9 years ago

Closes #3

mururu commented 9 years ago

benchmark results

require 'benchmark'
require 'strptime'

pr = Strptime.new("%d/%b/%Y %H:%M:%S")

Benchmark.bm 10 do |r|
  r.report "result" do
    5000000.times{ pr.exec("28/Feb/2013 12:00:00") }
  end
end

master

$ bundle exec ruby bench.rb
                 user     system      total        real
result       4.910000   0.020000   4.930000 (  5.046398)

no cache

$ bundle exec ruby bench.rb
                 user     system      total        real
result       8.220000   0.030000   8.250000 (  8.421462)

cache

$ bundle exec ruby bench.rb
                 user     system      total        real
result       4.980000   0.010000   4.990000 (  5.003196)
nurse commented 9 years ago

Great! thanks!!

mururu commented 9 years ago

Thank you!!