Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update benchmark to just run AR backend

  • Loading branch information...
commit 4add3bad63857bc59e209cbbac2a5a48db4172e4 1 parent dca7dd7
@bkeepers bkeepers authored
Showing with 6 additions and 26 deletions.
  1. +6 −26 benchmarks.rb
View
32 benchmarks.rb
@@ -1,33 +1,13 @@
-$:.unshift(File.dirname(__FILE__) + '/lib')
-require 'rubygems'
+require 'spec/spec_helper'
require 'logger'
-require 'delayed_job'
require 'benchmark'
-RAILS_ENV = 'test'
-
-Delayed::Worker.logger = Logger.new('/dev/null')
-
-BACKENDS = []
-Dir.glob("#{File.dirname(__FILE__)}/spec/setup/*.rb") do |backend|
- begin
- backend = File.basename(backend, '.rb')
- require "spec/setup/#{backend}"
- BACKENDS << backend.to_sym
- rescue LoadError
- puts "Unable to load #{backend} backend! #{$!}"
- end
-end
-
+# Delayed::Worker.logger = Logger.new('/dev/null')
Benchmark.bm(10) do |x|
- BACKENDS.each do |backend|
- require "spec/setup/#{backend}"
- Delayed::Worker.backend = backend
-
- n = 10000
- n.times { "foo".delay.length }
+ Delayed::Job.delete_all
+ n = 10000
+ n.times { "foo".delay.length }
- x.report(backend.to_s) { Delayed::Worker.new(:quiet => true).work_off(n) }
- end
+ x.report { Delayed::Worker.new(:quiet => true).work_off(n) }
end
Please sign in to comment.
Something went wrong with that request. Please try again.