Sha256: 1dc1ac49a3fe0c7605db793ddb65784806b372b5aa9aac4876c5e35554ca9265

Contents?: true

Size: 700 Bytes

Versions: 10

Compression:

Stored size: 700 Bytes

Contents

require 'stackprof'
require_relative '../lib/enhanced_errors' # Adjust the path if necessary

# gem install stackprof

# adjust path as needed
# ruby ./lib/core_ext/enhanced_errors/benchmark/stackprofile.rb
# dumps to current folder. read the stackprof dump:
# stackprof stackprof.dump

# Define the number of iterations
ITERATIONS = 10_000

def run_with_enhanced_errors
  EnhancedErrors.enhance!(debug: false)
  ITERATIONS.times do
    begin
      raise 'Test exception with EnhancedErrors'
    rescue => _e
      # Exception handled with EnhancedErrors.
    end
  end
end

def stackprofile
  StackProf.run(mode: :wall, out: 'stackprof.dump') do
    run_with_enhanced_errors
  end
end

stackprofile

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
enhanced_errors-1.0.0 benchmark/stackprofile.rb
enhanced_errors-0.1.8 benchmark/stackprofile.rb
enhanced_errors-0.1.7 benchmark/stackprofile.rb
enhanced_errors-0.1.6 benchmark/stackprofile.rb
enhanced_errors-0.1.5 benchmark/stackprofile.rb
enhanced_errors-0.1.4 benchmark/stackprofile.rb
enhanced_errors-0.1.3 benchmark/stackprofile.rb
enhanced_errors-0.1.2 benchmark/stackprofile.rb
enhanced_errors-0.1.1 benchmark/stackprofile.rb
enhanced_errors-0.1.0 benchmark/stackprofile.rb