Sha256: c6fa616bb7cc1c35aa364a03de9ae69cc678c22efed55f788a5bf1f333b8687d
Contents?: true
Size: 551 Bytes
Versions: 10
Compression:
Stored size: 551 Bytes
Contents
require_relative "../lib/zscan" require "benchmark" spec = ZScan::BSpec.new do int8 double_le double_le single_be end arr = [1, 1.1, 1.2, 1.3] str = arr.pack 'cE2g' z = Zscan.new str.b puts 'reference nop group' puts Benchmark.measure{ 100000.times{ z.pos = 0 } } puts 'ZScan#unpack' puts Benchmark.measure{ 100000.times{ z.pos = 0; z.unpack 'cE2g' } } puts 'ZScan#scan_bytes' puts Benchmark.measure{ 100000.times{ z.pos = 0; z.scan_bytes spec } } puts 'String#unpack' puts Benchmark.measure{ 100000.times{ z.pos = 0; str.unpack 'cE2g' } }
Version data entries
10 entries across 10 versions & 1 rubygems