Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Add a performance measurement option to the command line tool#297

Merged
cesarzc merged 19 commits intomasterfrom
cesarzc/command-line-tool-perf-option
Feb 4, 2020
Merged

Add a performance measurement option to the command line tool#297
cesarzc merged 19 commits intomasterfrom
cesarzc/command-line-tool-perf-option

Conversation

@cesarzc
Copy link
Contributor

@cesarzc cesarzc commented Jan 31, 2020

This change adds a performance measurement option (-p --perf) to the command line tool.

The overview of the change is that the compiler raises events when a task or sub-task starts or ends. Those events are tracked by a sub-component of the command line tool (CompilationTracker.cs) when the perf option is present. After the compilation process is done, the command line tool invokes the compilation tracker to publish the results of the tracking.

In a bit more detail, the compilation tracker builds a hierarchy of tasks and sub-tasks, and then writes that to a json file that contains the start time, end time and duration of each task and sub-task.

Here's an example of what the json looks like:
[ { "Task": { "ParentName": null, "Name": "OverallCompilation", "UtcStart": "2020-01-31T00:41:20.8402258Z", "UtcEnd": "2020-01-31T00:41:32.0618253Z", "DurationInMs": 11221 }, "Children": { "SourcesLoading": { "Task": { "ParentName": "OverallCompilation", "Name": "SourcesLoading", "UtcStart": "2020-01-31T00:41:20.8481749Z", "UtcEnd": "2020-01-31T00:41:21.4133199Z", "DurationInMs": 565 }, "Children": {} }, "ReferenceLoading": { "Task": { "ParentName": "OverallCompilation", "Name": "ReferenceLoading", "UtcStart": "2020-01-31T00:41:21.4133437Z", "UtcEnd": "2020-01-31T00:41:23.1862459Z", "DurationInMs": 1772 }, "Children": {} }, "Build": { "Task": { "ParentName": "OverallCompilation", "Name": "Build", "UtcStart": "2020-01-31T00:41:23.186258Z", "UtcEnd": "2020-01-31T00:41:30.1440662Z", "DurationInMs": 6957 }, "Children": {} }, "OutputGeneration": { "Task": { "ParentName": "OverallCompilation", "Name": "OutputGeneration", "UtcStart": "2020-01-31T00:41:30.1440802Z", "UtcEnd": "2020-01-31T00:41:32.0618242Z", "DurationInMs": 1917 }, "Children": { "SyntaxTreeSerialization": { "Task": { "ParentName": "OutputGeneration", "Name": "SyntaxTreeSerialization", "UtcStart": "2020-01-31T00:41:30.1440903Z", "UtcEnd": "2020-01-31T00:41:32.0235554Z", "DurationInMs": 1879 }, "Children": {} }, "BinaryGeneration": { "Task": { "ParentName": "OutputGeneration", "Name": "BinaryGeneration", "UtcStart": "2020-01-31T00:41:32.0235699Z", "UtcEnd": "2020-01-31T00:41:32.0618029Z", "DurationInMs": 38 }, "Children": {} } } } } } ]

Copy link
Contributor

@ScottCarda-MS ScottCarda-MS left a comment

Choose a reason for hiding this comment

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

There are some places where the use of the 'var' keyword is more standard in this code base than explicit type declarations. Please consider the suggestions changes I made.

@cesarzc
Copy link
Contributor Author

cesarzc commented Jan 31, 2020

There are some places where the use of the 'var' keyword is more standard in this code base than explicit type declarations. Please consider the suggestions changes I made.

Thanks for the feedback Scott. I made the changes that you suggested.

Copy link
Contributor

@bettinaheim bettinaheim left a comment

Choose a reason for hiding this comment

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

I've added a couple of comments. Overall it looks like a nice, clean piece of code - I like it!

@cesarzc cesarzc merged commit ae0fa64 into master Feb 4, 2020
@cesarzc cesarzc deleted the cesarzc/command-line-tool-perf-option branch May 18, 2020 20:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants