Performance: Buffer to string conversion
MEDIUM IMPACT
This concept affects the speed of converting binary data to readable text, impacting server response time and memory usage.
const str = buffer.toString('utf8'); // convert once and reuse
const str = buffer.toString('utf8'); // called multiple times unnecessarily
| Pattern | CPU Usage | Memory Usage | Latency Impact | Verdict |
|---|---|---|---|---|
| Repeated buffer.toString() calls | High | High | Increased latency | [X] Bad |
| Single buffer.toString() call reused | Low | Low | Minimal latency | [OK] Good |