rails/activejob — pull request #1 by charliesome (2014-05-18 15:30:18+00:00)
Title: Clean up JobWrappers::ResqueWrapper.perform

This is not only easier to read, but it'll also properly raise an `ArgumentError` rather than a `NoMethodError` when called with no arguments.

It also allocates 4 fewer objects per call (8 down from 12), and is about 84% faster according to this quick benchmark script:

```ruby
require "bundler/setup"
require "active_job"
require "active_job/job_wrappers/resque_wrapper"
require "benchmark/ips"

class MyJob
def self.perform(*args)
#
end
end

bk = proc do
ActiveJob::JobWrappers::ResqueWrapper.perform("MyJob", 1, 2, 3)
end

Benchmark.ips do |x|
x.report "" do
bk.call
bk.call
bk.call
bk.call
bk.call
bk.call
bk.call
bk.call
end
end
```

Before:

```
Calculating -------------------------------------
3787 i/100ms
-------------------------------------------------
41981.3 (±4.8%) i/s - 212072 in 5.064450s
```

After:

```
Calculating -------------------------------------
6686 i/100ms
-------------------------------------------------
77284.8 (±4.0%) i/s - 387788 in 5.026340s
```