Performance: Broadcasting to multiple clients
MEDIUM IMPACT
This concept affects the responsiveness and scalability of real-time updates sent to multiple clients, impacting interaction speed and server load.
await asyncio.gather(*(client.send_text(message) for client in clients))
for client in clients: await client.send_text(message)
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Sequential send in loop | N/A (server-side) | N/A | N/A | [X] Bad |
| Concurrent send with asyncio.gather | N/A (server-side) | N/A | N/A | [OK] Good |