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

node --prof documentation missing from --help output #34281

Closed
joliss opened this issue Jul 9, 2020 · 7 comments
Closed

node --prof documentation missing from --help output #34281

joliss opened this issue Jul 9, 2020 · 7 comments
Labels
cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations.

Comments

@joliss
Copy link
Contributor

joliss commented Jul 9, 2020

  • Version: v14.5.0
  • Platform: Linux

The node --prof option is documented on the website, but it's missing from the output of node --help.

@devsnek devsnek added cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations. labels Jul 9, 2020
@mmarchini
Copy link
Contributor

mmarchini commented Jul 9, 2020

I believe that's on purpose for the best since it is a V8 flag and is not officially supported by the V8 team (meaning it could get removed or the behavior could drastically change at any point). Besides, the help message is available via node --v8-options.

(edit: not sure if it was under documented on purpose or not, but I do believe describing too much what it does would be counter-productive)

@mmarchini
Copy link
Contributor

With that being said, we could explain a bit more and add a link to https://nodejs.org/en/docs/guides/simple-profiling/ to explain how to consume the profile output, although I think we should highlight that this flag is provided by V8 and therefore has less stability guarantees than flags maintained by Node.js.

@joliss
Copy link
Contributor Author

joliss commented Jul 9, 2020

I think just giving a hint might be useful. I found the --prof option on some blog post I found on Google, and it seemed to be doing something, but I was very confused when I didn't see it at least mentioned in --help.

@mmarchini
Copy link
Contributor

--prof is a V8 option, not a Node.js option. As a rule of thumb, we don't include V8 options on --help since those are not maintained by us*. --v8-options prints the help message from V8 with all V8 options. Would a message on top of --help like the list below includes only Node.js options. If you're looking for an option not listed below, check "--v8-options" for options provided by V8 help? Or we could add another section "Commonly Used V8 Options" (which is very subjective), although I'd rather not since we've been instructed several times by the V8 team to avoid documenting their flags since there's no stability guarantees for most of them.

FWIW, this is why I'm in favor of changing how we handle V8 options so instead of verbatim using them like --prof we would pass them as --v8-option="--prof", it makes explicit to the users that those options are not provided by Node.js.

* I see we have --abort-on-uncaught-exception on --help. V8 provides that flag but we implemented different behavior on top of V8, which makes it a hybrid V8/Node.js flag

@ghost
Copy link

ghost commented Jul 9, 2020

Actually, both options sound good. Though the first one requires less effort. However, the second one will be better in the long run IMO

@VikiD
Copy link

VikiD commented Dec 7, 2020

As a follow up regarding nodejs, you should check this article, might be useful for general info.
https://os-system.com/blog/12-types-of-node-js-applications-with-examples/

@Ayase-252
Copy link
Member

As I understand, it has been addressed by #34991 . Since it has been landed and I can verify the —prof doc is shown when exec node —help, I think the issue has been resolved, I will close the issue. Please feel free to reopen it, if you have further concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Issues and PRs related to the Node.js command line interface. doc Issues and PRs related to the documentations.
Projects
None yet
Development

No branches or pull requests

5 participants