Skip to content

Commit aca6427

Browse files
authored
Merge pull request #1858 from Kobzol/compilation-section-frontend
Improve computation of frontend compilation section
2 parents 644015d + 2b7adc9 commit aca6427

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

site/src/self_profile.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ async fn download_and_analyze_self_profile(
240240
/// backend, linker) from the self-profile queries.
241241
fn compute_compilation_sections(profile: &ProfilingData) -> Vec<CompilationSection> {
242242
let mut first_event_start = None;
243-
let mut frontend_end = None;
244243
let mut backend_start = None;
245244
let mut backend_end = None;
246245
let mut linker_duration = None;
@@ -250,10 +249,7 @@ fn compute_compilation_sections(profile: &ProfilingData) -> Vec<CompilationSecti
250249
first_event_start = event.payload.timestamp().map(|t| t.start());
251250
}
252251

253-
if event.label == "analysis" {
254-
// End of "analysis" => end of frontend
255-
frontend_end = event.payload.timestamp().map(|t| t.end());
256-
} else if event.label == "codegen_crate" {
252+
if event.label == "codegen_crate" {
257253
// Start of "codegen_crate" => start of backend
258254
backend_start = event.payload.timestamp().map(|t| t.start());
259255
} else if event.label == "finish_ongoing_codegen" {
@@ -266,7 +262,9 @@ fn compute_compilation_sections(profile: &ProfilingData) -> Vec<CompilationSecti
266262
}
267263
}
268264
let mut sections = vec![];
269-
if let (Some(start), Some(end)) = (first_event_start, frontend_end) {
265+
// We consider "frontend" to be everything from the start of the compilation (the first event)
266+
// to the start of the backend part.
267+
if let (Some(start), Some(end)) = (first_event_start, backend_start) {
270268
if let Ok(duration) = end.duration_since(start) {
271269
sections.push(CompilationSection {
272270
name: "Frontend".to_string(),

0 commit comments

Comments
 (0)