Skip to content

Add support for capturing cpu profiles into tsc itself #33586

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

Merged
merged 9 commits into from
Sep 27, 2019

Conversation

weswigham
Copy link
Member

@weswigham weswigham commented Sep 24, 2019

This way people can pretty easily capture a trace of their compilation just by passing --generateCpuProfile profile.cpuprofile alongside their existing compiler options. This essentially means that if you previously could send us extendedDiagnostics, this allows you to (probably) send us a cpuprofile.

capture-and-inspect-profile

This is implemented using node's builtin inspector library.


const commandLine = parseCommandLine(args);

if (commandLine.options.generateCpuProfile && sys.enableCPUProfiler) {
Copy link
Member

Choose a reason for hiding this comment

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

Error host doesn't support option if !sys.enableCPUProfiler ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should it? It's essentially just a diagnostics flag.

…prise people, add inspector to browser field
@weswigham weswigham merged commit 558ece7 into microsoft:master Sep 27, 2019
@weswigham weswigham deleted the trace-tsc branch September 27, 2019 20:34
@weswigham
Copy link
Member Author

Approved by @rbuckton offline ❤️

@weswigham
Copy link
Member Author

weswigham commented Sep 27, 2019

@DanielRosenwasser should we just document this on the wiki, like extendedDiagnsotics, and omit it from the release announcement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants