Closed Bug 1622316 Opened 4 years ago Closed 4 years ago

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

Categories

(Toolkit :: Crash Reporting, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla76
Performance Impact ?
Tracking Status
firefox76 --- fixed

People

(Reporter: florian, Assigned: gsvelto)

References

(Blocks 1 open bug)

Details

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

Attachments

(1 file)

See this profile: https://perfht.ml/38PsHqX (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
Status: NEW → ASSIGNED
Type: defect → enhancement
Priority: -- → P1
Blocks: 1588530
No longer depends on: 1588530
Pushed by gsvelto@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/88126ed3e760
Add buffering to the PlatformWriter to reduce the number of syscalls required to write the .extra file r=KrisWright
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
Performance Impact: --- → ?
Whiteboard: [qf][fxperf:p3] → [fxperf:p3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: