Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
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
Showing
37 changed files
with
3,165 additions
and
2,620 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.