Sha256: 92c244319161681edcf45fb9147be2978babf314e3bde49d77a7f8118f526877

Contents?: true

Size: 731 Bytes

Versions: 20

Compression:

Stored size: 731 Bytes

Contents

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

# gem install stackprof

# adjust path as needed
# ruby ./lib/core_ext/enhanced/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_exceptions!(debug: false, override_messages: true)
  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

20 entries across 20 versions & 1 rubygems

Version Path
enhanced_errors-3.0.7 benchmark/stackprofile.rb
enhanced_errors-3.0.6 benchmark/stackprofile.rb
enhanced_errors-3.0.5 benchmark/stackprofile.rb
enhanced_errors-3.0.4 benchmark/stackprofile.rb
enhanced_errors-3.0.3 benchmark/stackprofile.rb
enhanced_errors-3.0.2 benchmark/stackprofile.rb
enhanced_errors-3.0.1 benchmark/stackprofile.rb
enhanced_errors-3.0.0 benchmark/stackprofile.rb
enhanced_errors-2.2.0 benchmark/stackprofile.rb
enhanced_errors-2.1.3 benchmark/stackprofile.rb
enhanced_errors-2.1.2 benchmark/stackprofile.rb
enhanced_errors-2.1.1 benchmark/stackprofile.rb
enhanced_errors-2.1.0 benchmark/stackprofile.rb
enhanced_errors-2.0.6 benchmark/stackprofile.rb
enhanced_errors-2.0.5 benchmark/stackprofile.rb
enhanced_errors-2.0.4 benchmark/stackprofile.rb
enhanced_errors-2.0.3 benchmark/stackprofile.rb
enhanced_errors-2.0.2 benchmark/stackprofile.rb
enhanced_errors-2.0.1 benchmark/stackprofile.rb
enhanced_errors-2.0.0 benchmark/stackprofile.rb