Permalink
Browse files

Remove yaml based on JvYAMLb and add Yecht version 0.0.1 instead. Als…

…o update yaml tests as a copy from Ruby 1.8.7.
  • Loading branch information...
1 parent 877efe0 commit dc8d7f6cf8590cadafac2995738a23841f8621c2 @olabini olabini committed Jul 21, 2009
View
@@ -0,0 +1,20 @@
+
+require 'benchmark'
+require 'yaml'
+
+def bench_yaml(bm)
+ oldbm = $bm
+ $bm = bm
+
+ str = File.read(File.join(File.dirname(__FILE__), "big_yaml.yml"))
+ result = YAML.load(str)
+
+ $bm.report("1k parse") { 1_000.times { YAML.parse(str) } }
+ $bm.report("1k loads") { 1_000.times { YAML.load(str) } }
+ $bm.report("1k dumps") { 1_000.times { result.to_yaml } }
+ $bm.report("1k roundtrip") { 1_000.times { YAML.load(result.to_yaml) } }
+end
+
+if $0 == __FILE__
+ (ARGV[0] || 10).to_i.times { Benchmark.bm(30) {|bm| bench_yaml(bm)} }
+end
Oops, something went wrong.

0 comments on commit dc8d7f6

Please sign in to comment.