Closed Bug 1848090 Opened 2 years ago Closed 2 years ago

Opening a 300MB Chrome profile in Firefox profiler spends a lot of time around GCMinor

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
118 Branch
Tracking Status
firefox118 --- fixed

People

(Reporter: mayankleoboy1, Assigned: jonco)

References

(Blocks 1 open bug)

Details

Attachments

(4 files)

Open a 300MB Google Chrome profile in Firefox profiler

Profile of opening the Chrome profile: https://share.firefox.dev/3Oy7p7Y

This may be the expected behaviour or good enough behaviour. Feel free to resolve as invalid.

chrome trace part1

Chrome trace part2

Attached file about:support
Summary: Opening a 300MB Chrome profile in Firefox profiler spends a lot of time around GC → Opening a 300MB Chrome profile in Firefox profiler spends a lot of time around GCMinor

The JSON parser parser is creating a lot of nursery objects which all end up tenured. We could probably do the same thing we just did for structured clone deserialisation and stop allocating in the nursery after the first nursery collection.

Blocks: sm-js-perf
Severity: -- → S3
Priority: -- → P3
See Also: → 1713022
Assignee: nobody → jcoppeard

The patch adds a nursery collection callback for the duration of parsing and
counts the collections. After the second collection we switch to allocating
everything in the tenured heap.

JSON parsing allocates from the leaves of the tree upwards, unlike structured
clone deserialization which works from the root downwards. Because of this it
doesn't always make sense to stop nursery allocation after the first
collection, as this doesn't doom the whole data structure to being tenured. We
don't know ahead of time how big the resulting data structure will be but after
two nursery collections then at least half of it will end up tenured.

This change made parsing the JSON data in the bug significantly faster.

Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fc9820aab42f When parsing JSON, Stop allocating in the nursery after two nursery collections r=sfink
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 118 Branch

Profile: https://share.firefox.dev/45fgTvY
So 12.6seconds -> 5.2 seconds
Time spent in GCMinor is all but gone (except in a few places). This is a nice improvement, thanks!

See Also: → 1853305
See Also: → 1925128
See Also: 1925128
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: