Skip to content

Instantly share code, notes, and snippets.

@chrismcg
Created June 13, 2012 08:36
Show Gist options
  • Save chrismcg/2922816 to your computer and use it in GitHub Desktop.
Save chrismcg/2922816 to your computer and use it in GitHub Desktop.
Yaml load benchmarking
chris@zippy % rvm 1.9.3-p0,1.9.3-p194 do ruby psych_benchmarker.rb
Calculating -------------------------------------
YAML 3929 i/100ms
-------------------------------------------------
YAML 44438.5 (±11.9%) i/s - 220024 in 5.035159s
Calculating -------------------------------------
YAML 350 i/100ms
-------------------------------------------------
YAML 3563.2 (±1.9%) i/s - 17850 in 5.011440s
require 'benchmark/ips'
require 'yaml'
yaml_str = YAML.dump('')
Benchmark.ips do |x|
x.report("YAML") { YAML.load(yaml_str) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment