Tags: dart-lang/native
Tags
[hooks_runner] Add `TimelineEvents` (#2327) This PR adds timeline events to the `hooks_runner` package: * All `FileSystem` calls. (With a `TracingFileSystem`.) * All `Process` runs. * The main methods. This enables looking at the performance: <img width="990" alt="image" src="https://github.com/user-attachments/assets/6a5c78be-46b7-4a0a-bc9a-ada325a30193" /> (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: * The current approach only works for non-concurrent events. (The stdout and stderr file logging is concurrent to the process calls and therefore has to be excluded.) If we ever start doing things concurrently, we'll need to refactor this. * There are a lot of possibilities to improve things when we have more than one hook in the system. Optimizing this only makes sense once we have more real world projects using hooks. * Tracking issues for improving the performance: #1288 #1578 The 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
PreviousNext