Don't mark and sweep defaultCompartment

NEW
Unassigned

Status

()

8 years ago
4 years ago

People

(Reporter: gwagner, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

8 years ago
Since all atoms are in the defaultCompartment and no other objects are in there we can avoid marking the atoms and sweeping the defaultCompartment.
I measured about 2% gc pause time reduction in the browser.

Comment 1

8 years ago
(In reply to comment #0)
> Since all atoms are in the defaultCompartment and no other objects are in there
> we can avoid marking the atoms and sweeping the defaultCompartment.

Hm, but how do you collect the atoms? I.e. how would OOM be prevented in a test case like:

var obj  = {};
for (var i = 0; i != 1e9; ++i)
    delete obj["a"+i];

Here 1e9 temporary atoms are allocated and nothing else.
(Reporter)

Comment 2

8 years ago
Sure we need a mechanism to avoid oom due to atoms creation.
My observation is that atoms normally don't show a high throughput rate and we don't need to mark and sweep them for each single GC run.

My idea is to come back to this bug once we can GC single compartments and see if we can optimize for atoms.
(In reply to Gregor Wagner [:gwagner] from comment #2)
> My idea is to come back to this bug once we can GC single compartments and
> see if we can optimize for atoms.
I think we are able to do this today.
(Assignee)

Updated

4 years ago
Assignee: general → nobody
You need to log in before you can comment on or make changes to this bug.