Sha256: a0c4e8782ce9703c5e00fc28b9b8957b1d652b702b142a20001349cb44ce9160

Contents?: true

Size: 544 Bytes

Versions: 19

Compression:

Stored size: 544 Bytes

Contents

require 'bundler/setup'
require_relative './active_record_setup'
require 'flipper'
require 'flipper/adapters/active_record'
require 'benchmark/ips'

flipper = Flipper.new(Flipper::Adapters::ActiveRecord.new)

2000.times do |i|
  flipper.enable_actor :foo, Flipper::Actor.new("User;#{i}")
end

Benchmark.ips do |x|
  x.report("all") { Flipper::Adapters::ActiveRecord::Gate.where(feature_key: "foo".freeze).load }
  x.report("pluck") { Flipper::Adapters::ActiveRecord::Gate.where(feature_key: "foo".freeze).pluck(:key, :value) }
  x.compare!
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
flipper-active_record-1.3.2 benchmark/active_record_ips.rb
flipper-active_record-1.3.1 benchmark/active_record_ips.rb
flipper-active_record-1.3.0 benchmark/active_record_ips.rb
flipper-active_record-1.3.0.pre benchmark/active_record_ips.rb
flipper-active_record-1.2.2 benchmark/active_record_ips.rb
flipper-active_record-1.2.1 benchmark/active_record_ips.rb
flipper-active_record-1.2.0 benchmark/active_record_ips.rb
flipper-active_record-1.1.2 benchmark/active_record_ips.rb
flipper-active_record-1.1.1 benchmark/active_record_ips.rb
flipper-active_record-1.1.0 benchmark/active_record_ips.rb
flipper-active_record-1.0.0 benchmark/active_record_ips.rb
flipper-active_record-1.0.0.pre benchmark/active_record_ips.rb
flipper-active_record-0.28.3 benchmark/active_record_ips.rb
flipper-active_record-0.28.2 benchmark/active_record_ips.rb
flipper-active_record-0.28.1 benchmark/active_record_ips.rb
flipper-active_record-0.28.0 benchmark/active_record_ips.rb
flipper-active_record-0.27.1 benchmark/active_record_ips.rb
flipper-active_record-0.27.0 benchmark/active_record_ips.rb
flipper-active_record-0.26.2 benchmark/active_record_ips.rb