Closed Bug 1622316 Opened 2 years ago Closed 2 years ago

CrashReporter::WriteExtraFile does many small write calls on the main thread


(Toolkit :: Crash Reporting, enhancement, P1)




Tracking Status
firefox76 --- fixed


(Reporter: florian, Assigned: gsvelto)


(Blocks 1 open bug)


(Keywords: perf, Whiteboard: [qf][fxperf:p3])


(1 file)

See this profile: (this is a subset of the massive startup profile from bug 1618129 comment 9)

In addition to CrashReporter::CreateMinidumpsAndPair being very slow (already filed in bug 1550754), in this profile we see CrashReporter::WriteExtraFile writing JSON file(s) to disk very inefficiently.

Summary: CrashReporter::WriteExtraFile does plenty of small write calls on the main thread → CrashReporter::WriteExtraFile does many small write calls on the main thread

The PlatformWriter is ridiculously inefficient because it does no buffering at all. With JSON this ends up requiring a ton of syscalls. Adding a minimum of buffering is certainly possible though it needs to happen on the stack because it needs to work from within an exception handler and thus cannot allocate memory.

That being said I'm rewriting all that code in Rust (see meta bug 1588530) and it's all going to run out-of-process so it might not be worth the fuss unless it's important to fix it now.

Normally I'd make this a fxperf:p2, but since it looks like the underlying mechanism is being re-written, and this should address this, making this an fxperf:p3. If we scrub the p3 list and find this is still an issue down the line, we can revisit.

Depends on: 1588530
Priority: -- → P3
Priority: P3 → --
Whiteboard: [qf][fxperf] → [qf][fxperf:p]
Whiteboard: [qf][fxperf:p] → [qf][fxperf:p3]

This is a bug in the crash reporter, so I am moving this bug to the Crash Reporting component.

Component: DOM: Content Processes → Crash Reporting
Product: Core → Toolkit

Since the fix is small and we're updating breakpad too there's no hurt in addressing this before the rewrite. Taking it.

Assignee: nobody → gsvelto
Type: defect → enhancement
Priority: -- → P1
Blocks: 1588530
No longer depends on: 1588530
Pushed by
Add buffering to the PlatformWriter to reduce the number of syscalls required to write the .extra file r=KrisWright
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.