Issue
I am trying to use profiling with a Node/TypeScript backend. However, most of the functions are showing up in the profiler with names "fulfilled" or "__awaiter".
Applies To
- All customers using Profiling
- Express/Node/Typescript projects
Symptoms
- Functions in the profiler are showing up with names "fulfilled" or "__awaiter". There is no clear indication of where these names are coming from in the codebase.
Resolution
This issue arises due to a limitation of the async/await implementation inside V8 (the JavaScript engine used by Node.js). The async/await stack traces are not a single stack trace but are actually spread out over time. This is why you see them all being disconnected at the "fulfilled" frame, where the async operation happens.
In such cases, we suggest focusing on the aggregate flamegraph and looking for functions with a high sample count. The main idea is that by optimizing functions that frequently occupy the call stack, you can still improve the runtime of the program without focusing on its chronological execution.
Lastly, ensure that your errors have a source map specified. Without source maps, the profiler may not accurately reflect the original source code, leading to less clear insights.