1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/benchmark/objspace_dump_all.yml

14 lines
421 B
YAML
Raw Normal View History

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