Optimized for: Gemini / ChatGPT / Claude
Advanced AI Prompt for Node.js Event Loop and Async Optimization
Use this engineered prompt to drastically optimize your workflow and output.
Required Variables
- ✦
[ASYNC_CODE_BLOCK] - ✦
[PROMISE_PATTERN] - ✦
[TIMEOUT_SETTINGS]
nodejs-event-loop-lambda-optimization.txt
Inspect the [ASYNC_CODE_BLOCK] for unoptimized [PROMISE_PATTERN] that may cause the Lambda to remain active longer than necessary. Identify 'await' calls that could be executed in parallel using Promise.all(). Evaluate the impact of 'callbackWaitsForEmptyEventLoop' settings on execution time and cost. Provide a refactored version of the code that optimizes the event loop and reduces total billed duration.
Example Output
"The AI would refactor sequential await calls into parallel promises, reducing the billed duration from 1200ms to 450ms."