Performance: Active Job framework
MEDIUM IMPACT
Active Job affects background job processing, which impacts user interaction responsiveness and server load handling.
class UsersController < ApplicationController def create WelcomeEmailJob.perform_later(@user.id) # other code end end class WelcomeEmailJob < ApplicationJob queue_as :default def perform(user_id) user = User.find(user_id) UserMailer.welcome_email(user).deliver_now end end
class UsersController < ApplicationController def create UserMailer.welcome_email(@user).deliver_now # other code end end
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous task in request | N/A | N/A | Blocks response, delays paint | [X] Bad |
| Background job with Active Job | N/A | N/A | Non-blocking, faster response | [OK] Good |