Performance: os.platform and os.arch
LOW IMPACT
These methods provide system information and do not affect page load or rendering performance but can impact server-side decision-making speed.
const os = require('os'); const platform = os.platform(); const arch = os.arch(); // Store once and reuse for all requests
const platform = require('os').platform(); const arch = require('os').arch(); // Called repeatedly inside a loop or request handler
| Pattern | CPU Usage | Event Loop Blocking | System Calls | Verdict |
|---|---|---|---|---|
| Repeated calls to os.platform() and os.arch() | High | Multiple short blocks | Multiple | [X] Bad |
| Single call cached and reused | Low | Minimal | Single | [OK] Good |