Closed martijn closed 2 years ago
Turns out this is actually a lot slower and allocating more due to how #read is implemented in Rubyzip. This is probably why I went with sysread initially :)
./benchmark.rb on main
--- ARRAY MODE --- Performance benchmark: 1.0193964000092819s avg 0.009340342315816343s stdev Calculating ------------------------------------- 883.133M memsize ( 1.007k retained) 2.373M objects ( 12.000 retained) 50.000 strings ( 2.000 retained) --- HASH MODE --- Performance benchmark: 1.4067317999899387s avg 0.04825439805105081s stdev Calculating ------------------------------------- 886.334M memsize ( 1.650k retained) 2.433M objects ( 16.000 retained) 50.000 strings ( 3.000 retained)
./benchmark.rb on bufferless-parser
--- ARRAY MODE --- Performance benchmark: 2.526302199973725s avg 0.02019858371069751s stdev Calculating ------------------------------------- 8.051B memsize ( 1.007k retained) 3.593M objects ( 12.000 retained) 50.000 strings ( 2.000 retained) --- HASH MODE --- Performance benchmark: 3.0494400000199677s avg 0.17171053600326805s stdev Calculating ------------------------------------- 8.054B memsize ( 1.650k retained) 3.653M objects ( 16.000 retained) 50.000 strings ( 3.000 retained)
Turns out this is actually a lot slower and allocating more due to how #read is implemented in Rubyzip. This is probably why I went with sysread initially :)
./benchmark.rb on main
./benchmark.rb on bufferless-parser