Sha256: e3e9aa22479f9627f0ee9d3a767848993ea96af88c12a6323e4ff65974121555

Contents?: true

Size: 657 Bytes

Versions: 16

Compression:

Stored size: 657 Bytes

Contents

require 'bundler/setup'
require 'flipper'
require 'benchmark/ips'

actor1 = Flipper::Actor.new("User;1")
actor2 = Flipper::Actor.new("User;2")
actor3 = Flipper::Actor.new("User;3")
actor4 = Flipper::Actor.new("User;4")
actor5 = Flipper::Actor.new("User;5")
actor6 = Flipper::Actor.new("User;6")
actor7 = Flipper::Actor.new("User;7")
actor8 = Flipper::Actor.new("User;8")

actors = [actor1, actor2, actor3, actor4, actor5, actor6, actor7, actor8]

Benchmark.ips do |x|
  x.report("with array of actors") { Flipper.enabled?(:foo, actors) }
  x.report("with multiple enabled? checks") { actors.each { |actor| Flipper.enabled?(:foo, actor) } }
  x.compare!
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
flipper-1.3.2 benchmark/enabled_multiple_actors_ips.rb
flipper-1.3.1 benchmark/enabled_multiple_actors_ips.rb
flipper-1.3.0 benchmark/enabled_multiple_actors_ips.rb
flipper-1.3.0.pre benchmark/enabled_multiple_actors_ips.rb
flipper-1.2.2 benchmark/enabled_multiple_actors_ips.rb
flipper-1.2.1 benchmark/enabled_multiple_actors_ips.rb
flipper-1.2.0 benchmark/enabled_multiple_actors_ips.rb
flipper-1.1.2 benchmark/enabled_multiple_actors_ips.rb
flipper-1.1.1 benchmark/enabled_multiple_actors_ips.rb
flipper-1.1.0 benchmark/enabled_multiple_actors_ips.rb
flipper-1.0.0 benchmark/enabled_multiple_actors_ips.rb
flipper-1.0.0.pre benchmark/enabled_multiple_actors_ips.rb
flipper-0.28.3 benchmark/enabled_multiple_actors_ips.rb
flipper-0.28.2 benchmark/enabled_multiple_actors_ips.rb
flipper-0.28.1 benchmark/enabled_multiple_actors_ips.rb
flipper-0.28.0 benchmark/enabled_multiple_actors_ips.rb