Sha256: 9d6f6e2f1ac2c7847baab5d3f1df23dc38bd98742bab8ea4b259c34ba2827350

Contents?: true

Size: 347 Bytes

Versions: 32

Compression:

Stored size: 347 Bytes

Contents

#!/usr/bin/env ruby

require_relative 'memory'

require_relative "../../lib/async/io/stream"
require "stringio"

measure_memory("Stream setup") do
	@io = StringIO.new("a" * (50*1024*1024))
	@stream = Async::IO::Stream.new(@io)
end # 50.0 MB

measure_memory("Read all chunks") do
	while chunk = @stream.read_partial
		chunk.clear
	end
end # 0.5 MB

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
async-io-1.27.2 examples/allocations/read_chunks.rb
async-io-1.27.1 examples/allocations/read_chunks.rb
async-io-1.27.0 examples/allocations/read_chunks.rb
async-io-1.26.0 examples/allocations/read_chunks.rb
async-io-1.25.0 examples/allocations/read_chunks.rb
async-io-1.24.0 examples/allocations/read_chunks.rb
async-io-1.23.3 examples/allocations/read_chunks.rb
async-io-1.23.1 examples/allocations/read_chunks.rb
async-io-1.23.0 examples/allocations/read_chunks.rb
async-io-1.22.0 examples/allocations/read_chunks.rb
async-io-1.21.0 examples/allocations/read_chunks.rb
async-io-1.20.0 examples/allocations/read_chunks.rb
async-io-1.18.5 examples/allocations/read_chunks.rb
async-io-1.18.4 examples/allocations/read_chunks.rb
async-io-1.18.3 examples/allocations/read_chunks.rb
async-io-1.18.2 examples/allocations/read_chunks.rb
async-io-1.18.1 examples/allocations/read_chunks.rb
async-io-1.17.2 examples/allocations/read_chunks.rb
async-io-1.17.1 examples/allocations/read_chunks.rb
async-io-1.16.4 examples/allocations/read_chunks.rb