Skip to content

Instantly share code, notes, and snippets.

View sachin-metacube's full-sized avatar

Sachin Singh sachin-metacube

View GitHub Profile
@dilkhush
dilkhush / handle_asynchronously_vs_custom_delayed_job_benchmark.txt
Last active January 19, 2018 09:01
Delayed_job #handle_asynchronously Vs custom delayed job benchmarking
require 'benchmark'
u = User.find 1
no_of_count = 1000
Benchmark.bmbm do |x|
x.report("handle_asynchronously") { no_of_count.times { u.method_name_for_background_run } }
x.report("custom delayed job") { no_of_count.times { TestJob.new(u.id).delay } }
end
Output: