Sha256: 56817d8b7bf11b6cbbd978066cbb987c17f4f128078ac2da1a8701a55db4638d

Contents?: true

Size: 474 Bytes

Versions: 5

Compression:

Stored size: 474 Bytes

Contents

$LOAD_PATH.unshift File.expand_path("../../../lib", __FILE__)
require "allocation_stats"
require 'rspec/mocks/standalone'

def benchmark_allocations(burn: 1)
  stats = AllocationStats.new(:burn => burn).trace do
    yield
  end

  columns = if ENV['DETAIL']
              [:sourcefile, :sourceline, :class_plus]
            else
              [:class_plus]
            end

  puts stats.allocations(:alias_paths => true).group_by(*columns).from_pwd.sort_by_size.to_text
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
opal-rspec-1.1.0.alpha3 rspec-mocks/upstream/benchmarks/allocations/helper.rb
opal-rspec-1.1.0.alpha2 rspec-mocks/upstream/benchmarks/allocations/helper.rb
opal-rspec-1.1.0.alpha1 rspec-mocks/upstream/benchmarks/allocations/helper.rb
opal-rspec-1.0.0 rspec-mocks/upstream/benchmarks/allocations/helper.rb
opal-rspec-1.0.0.alpha1 rspec-mocks/upstream/benchmarks/allocations/helper.rb