Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add performance note to --enable-source-maps docs #43817

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ effort to report stack traces relative to the original source file.
Overriding `Error.prepareStackTrace` prevents `--enable-source-maps` from
modifying the stack trace.

Note, Accessing `Error.stack` with source maps enabled can be an expensive
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like:

Note, enabling source maps can introduce latency to your application when Error.stack is accessed. If you access Error.stack in the hot path of your application, take into account the performance implications of --enable-source-maps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly do we mean by hot path here? I am guessing it means some place which is called often?

How about

Note, enabling source maps can introduce latency to your application when Error.stack is accessed. If you access Error.stack frequently in your application, take into account the performance implications of --enable-source-maps.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have made the above change ^. Let me know if it looks ok and if I understood it correct.

operation. Do check out the performance implications of `--enable-source-maps`
at [nodejs/node#41541](https://github.com/nodejs/node/issues/41541).

### `--experimental-global-webcrypto`

<!-- YAML
Expand Down