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
Add a performance measurement option to the command line tool#297
Conversation
added 13 commits
January 27, 2020 12:51
…tion, the code to make it work was not implemented as part of this commit).
…compiler event tracking.
ScottCarda-MS
approved these changes
Jan 31, 2020
Contributor
ScottCarda-MS
left a comment
There was a problem hiding this comment.
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.
Contributor
Author
Thanks for the feedback Scott. I made the changes that you suggested. |
bettinaheim
approved these changes
Feb 2, 2020
Contributor
bettinaheim
left a comment
There was a problem hiding this comment.
I've added a couple of comments. Overall it looks like a nice, clean piece of code - I like it!
Co-Authored-By: bettinaheim <34236215+bettinaheim@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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": {} } } } } } ]