Created
June 13, 2012 08:36
-
-
Save chrismcg/2922816 to your computer and use it in GitHub Desktop.
Yaml load benchmarking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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