Performance: Why background processing handles heavy tasks
HIGH IMPACT
This concept affects the responsiveness and interaction speed of a web application by offloading heavy tasks from the main request thread.
async handleRequest() { this.queueBackgroundTask(); return { status: 'queued' }; } // Background worker processes the heavy task separately
async handleRequest() { await this.processHeavyTask(); return { status: 'done' }; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Heavy task in request handler | Minimal | 0 | 0 | [X] Bad |
| Heavy task in background queue | Minimal | 0 | 0 | [OK] Good |