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

23 lines
740 B
YAML
Raw Normal View History

prelude: |
smallint_array = 1000.times.map { |x| x }
bigint32_array = 1000.times.map { |x| x + 2**32 }
bigint64_array = 1000.times.map { |x| x + 2**64 }
smallint_dump = Marshal.dump(smallint_array)
bigint32_dump = Marshal.dump(bigint32_array)
bigint64_dump = Marshal.dump(bigint64_array)
benchmark:
marshal_dump_integer_small: |
Marshal.dump(smallint_array)
marshal_dump_integer_over_32_bit: |
Marshal.dump(bigint32_array)
marshal_dump_integer_over_64_bit: |
Marshal.dump(bigint64_array)
marshal_load_integer_small: |
Marshal.load(smallint_dump)
marshal_load_integer_over_32_bit: |
Marshal.load(bigint32_dump)
marshal_load_integer_over_64_bit: |
Marshal.load(bigint64_dump)
loop_count: 4000