Sha256: 4fc8dcf12947d01daee0ea48179cd207cac0ec1deb2fd7ce9b8977b50186989d

Contents?: true

Size: 410 Bytes

Versions: 14

Compression:

Stored size: 410 Bytes

Contents

# frozen-string-literal: true

require 'memory_profiler'
require 'did_you_mean'

# public def foo; end
# error      = (self.fooo rescue $!)
# executable = -> { error.to_s }

METHODS    = ''.methods
INPUT      = 'start_with?'
collection = DidYouMean::SpellChecker.new(dictionary: METHODS)
executable = proc { collection.correct(INPUT) }

GC.disable
MemoryProfiler.report { 100.times(&executable) }.pretty_print

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
did_you_mean-1.6.3 benchmark/memory_usage.rb
did_you_mean-1.6.2 benchmark/memory_usage.rb
did_you_mean-1.6.1 benchmark/memory_usage.rb
did_you_mean-1.5.0 benchmark/memory_usage.rb
did_you_mean-1.4.0 benchmark/memory_usage.rb
did_you_mean-1.3.1 benchmark/memory_usage.rb
did_you_mean-1.2.2 benchmark/memory_usage.rb
did_you_mean-1.1.3 benchmark/memory_usage.rb
did_you_mean-1.3.0 benchmark/memory_usage.rb
did_you_mean-1.2.1 benchmark/memory_usage.rb
did_you_mean-1.2.0 benchmark/memory_usage.rb
did_you_mean-1.1.2 benchmark/memory_usage.rb
ruby-compiler-0.1.1 vendor/ruby/gems/did_you_mean-1.1.0/benchmark/memory_usage.rb
did_you_mean-1.1.0 benchmark/memory_usage.rb