-
Notifications
You must be signed in to change notification settings - Fork 69
[hooks_runner] Add TimelineEvents
#2327
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
Conversation
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
PR HealthChangelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
|
}) async { | ||
final packageGraphJsonFile = fileSystem.file( | ||
packageConfigUri.resolve('package_graph.json'), | ||
); | ||
assert(packageGraphJsonFile.existsSync()); | ||
assert(await packageGraphJsonFile.exists()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work? I was under the impression that code in asserts has to be synchronous? A quick experiment in dartpad with assert(await Future.value(false));
also seems to indicate that it wouldn't fire as expected...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, never mind. This works. Dartpad doesn't have asserts enabled it seems.
/// it up in multiple tasks. | ||
final _task = TimelineTask(); | ||
|
||
/// Traced by [_task], cannot be used for concurrent actions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Include a note that this used _fileSystemUntraced under the hood.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This PR adds timeline events to the
hooks_runner
package:FileSystem
calls. (With aTracingFileSystem
.)Process
runs.This enables looking at the performance:
(First build compiles the hook and runs the hook. Second build doesn't compile the hook and doesn't run the hook. Side note: Compiling Dart takes longer than running the hook (compiling C)!)
Some quirks:
hook/{build,link}.dart
once. #1578The one improvement made in this PR is that we stop hashing the kernel file contents. Saving a hook invocation if the kernel file didn't change (~300ms) if the hook sources only had a whitespace change seems less valuable than saving the hashing of the hook kernel file on every invocation (~50ms). After this change, cached hook invocations take ~30ms per hook on the local test cases.
Closes: #2236