%PDF- %PDF-
| Direktori : /opt/plesk/ruby/2.6.3/lib64/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/benchmark/ |
| Current File : //opt/plesk/ruby/2.6.3/lib64/ruby/gems/2.6.0/gems/did_you_mean-1.3.0/benchmark/memory_usage.rb |
# 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