Performance: Feedback collection and annotation
MEDIUM IMPACT
This concept affects the responsiveness and throughput of the application when collecting and processing user feedback, impacting user experience and system load.
async function collectFeedback(feedback) { saveToDatabase(feedback); // save immediately annotateFeedback(feedback).then(annotated => { updateDatabase(annotated); }); return feedback; }
async function collectFeedback(feedback) { const annotated = await annotateFeedback(feedback); // blocking annotation saveToDatabase(annotated); return annotated; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous annotation during feedback collection | Minimal | Multiple (due to blocking) | High (delayed) | [X] Bad |
| Asynchronous annotation after saving feedback | Minimal | Single or none | Low (smooth) | [OK] Good |