-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add support for artifact size profiling #87404
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,7 +222,7 @@ impl<K: DepKind> EncoderState<K> { | |
index | ||
} | ||
|
||
fn finish(self) -> FileEncodeResult { | ||
fn finish(self, profiler: &SelfProfilerRef) -> FileEncodeResult { | ||
let Self { mut encoder, total_node_count, total_edge_count, result, stats: _ } = self; | ||
let () = result?; | ||
|
||
|
@@ -235,7 +235,11 @@ impl<K: DepKind> EncoderState<K> { | |
IntEncodedWithFixedSize(edge_count).encode(&mut encoder)?; | ||
debug!("position: {:?}", encoder.position()); | ||
// Drop the encoder so that nothing is written after the counts. | ||
encoder.flush() | ||
let result = encoder.flush(); | ||
// FIXME(rylev): we hardcode the dep graph file name so we don't need a dependency on | ||
// rustc_incremental just for that. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rustc_incremental already depends on rustc_query_impl (directly or through rustc_middle). You can export a const to be accessed by rustc_incremental. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that would actually introduce a circular dependency, right?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe the failure mode here if the dep graph file name changes is just that we have the wrong file name in the self-profile data which doesn't seem important enough to add the dependency, so this seems fine. |
||
profiler.artifact_size("dep_graph", "dep-graph.bin", encoder.position() as u64); | ||
result | ||
} | ||
} | ||
|
||
|
@@ -332,6 +336,6 @@ impl<K: DepKind + Encodable<FileEncoder>> GraphEncoder<K> { | |
|
||
pub fn finish(self, profiler: &SelfProfilerRef) -> FileEncodeResult { | ||
let _prof_timer = profiler.generic_activity("incr_comp_encode_dep_graph"); | ||
self.status.into_inner().finish() | ||
self.status.into_inner().finish(profiler) | ||
} | ||
} |
Uh oh!
There was an error while loading. Please reload this page.