Uh oh!
There was an error while loading. Please reload this page.
src: implement --trace-promises - #50899
Conversation
nodejs-github-bot
commented
Nov 24, 2023
Review requested:
|
GeoffreyBooth
left a comment
There was a problem hiding this comment.
This will be very useful! Just needs docs.
The
notable-change Please suggest a text for the release notes if you'd like to include a more detailed summary, then proceed to update the PR description with the text or a link to the notable change suggested text comment. Otherwise, the commit will be placed in the Other Notable Changes section. |
Uh oh!
There was an error while loading. Please reload this page.
I think this should be a core developer debugging flag (we have several of those, like --verify-base-objects and --inspect-brk-node) so we should avoid documenting it. At least for now, lest some user depends on it. We can consider documenting it later when it's used a bit more internally. (I am not even sure if this is free of bugs, but as far as I've tested it works well enough). |
theanarkh
commented
Nov 25, 2023
Does |
I think the cost can be non-trivial, depending on how promise-heavy the use case is, although it’s just a debugging flag so it’s not supposed to be turned on in any case that care about performance. |
This patch implements a debugging flag that dumps the current stack trace when a promise is created or resolved. To reduce noise we ignore before and after events (as the execution is less interesting) and use the per-isolate hook to avoid extra JS frames. This flag can assist work in reducing unnecessary promise overhead.
27409f1 to
668ab33Comparejoyeecheung
commented
Nov 27, 2023
Removed it from the tests because we are intentionally not documenting it for now. |
nodejs-github-bot
commented
Nov 27, 2023
nodejs-github-bot
commented
Nov 27, 2023
benjamingr
commented
Nov 27, 2023
Pretty significant but being set in C++ helps |
nodejs-github-bot
commented
Nov 28, 2023
nodejs-github-bot
commented
Nov 28, 2023
nodejs-github-bot
commented
Nov 30, 2023
nodejs-github-bot
commented
Dec 1, 2023
nodejs-github-bot
commented
Dec 1, 2023
nodejs-github-bot
commented
Dec 3, 2023
nodejs-github-bot
commented
Dec 5, 2023
Landed in 1e31a01 |
This patch implements a debugging flag that dumps the current stack trace when a promise is created or resolved. To reduce noise we ignore before and after events (as the execution is less interesting) and use the per-isolate hook to avoid extra JS frames. This flag can assist work in reducing unnecessary promise overhead. PR-URL: #50899 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
FYI, I created a feature request for a "promise dump" of a currently running program. I thought I'd mention it here because it might be another useful dev tool like |
This patch implements a debugging flag that dumps the current stack trace when a promise is created or resolved. To reduce noise we ignore before and after events (as the execution is less interesting) and use the per-isolate hook to avoid extra JS frames. This flag can assist work in reducing unnecessary promise overhead. PR-URL: #50899 Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io> Reviewed-By: Geoffrey Booth <webadmin@geoffreybooth.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This patch implements a debugging flag that dumps the current stack trace when a promise is created or resolved. To reduce noise we ignore before and after events (as the execution is less interesting) and use the per-isolate hook to avoid extra JS frames. This flag can assist work in reducing unnecessary promise overhead.