ruby/benchmark/objspace_dump_all.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 строки
421 B
YAML
Исходник Обычный вид История

prelude: |
require 'objspace'
require 'tempfile'
$objs = 1_000.times.map { Object.new }
$strings = 1_000.times.map { |i| "string #{i}" }
$file = Tempfile.new('heap')
$dev_null = File.open(File::NULL, 'w+')
benchmark:
dump_all_string: "ObjectSpace.dump_all(output: :string)"
dump_all_file: "ObjectSpace.dump_all(output: $file)"
dump_all_dev_null: "ObjectSpace.dump_all(output: $dev_null)"
loop_count: 1