Skip to content

Super slow #6

@ridiculous

Description

@ridiculous

This is a cool gem, but it's super slow compared to alternatives. Are there plans to improve on that?

Here is a simple benchmark against memo-it and memoist

require 'benchmark/ips'
module Go
  extend Memoist
  extend self

  def go_memo_it
    memo { false }
  end

  def go_memoist
    false
  end

  memoize :go_memoist
end

Benchmark.ips do |x|
  x.warmup = 3
  x.time = 10
  x.report('memo-it') { Go.go_memo_it }
  x.report('memoist') { Go.go_memoist }
end

=begin
Warming up --------------------------------------
             memo-it    16.623k i/100ms
             memoist   127.203k i/100ms
Calculating -------------------------------------
             memo-it    185.206k (± 7.1%) i/s -      1.845M in  10.010942s
             memoist      2.252M (± 6.8%) i/s -     22.515M in  10.044946s
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions