Performance: Creating documents
MEDIUM IMPACT
This affects server response time and how quickly the client receives the document content.
app.get('/doc', async (req, res) => { const doc = await generateLargeDocumentAsync(); res.send(doc); });
app.get('/doc', (req, res) => {
const doc = generateLargeDocumentSync();
res.send(doc);
});| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Synchronous document creation | N/A (server-side) | N/A | N/A | [✗] Bad |
| Asynchronous document creation | N/A (server-side) | N/A | N/A | [✓] Good |