Closed Bug 1997702 Opened 8 months ago Closed 7 months ago

Testcase creating long chains of microtasks is 8x slower with the new microtaskQueue. Spends all the time in MinorGC tracing js::MicroTaskQueueSet::trace and TraceableFifo::trace

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
146 Branch
Tracking Status
firefox146 --- fixed

People

(Reporter: mayankleoboy1, Assigned: mgaudet)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

Attached file Microtask stress.HTML

enable the new js-managed-microtask
Open attached testcase
click run

default microtask: https://share.firefox.dev/4hLOHIo (9s)
new microtask: https://share.firefox.dev/4oMt1xS (72s)

Testcase created using chatgpt. 100% artificial.
Deliberately not making this bug bug 1990841 as this is a stress-test.

Attached file chained promises.HTML

Perhaps an equivalent and simpler testcase.
N=5000000
Profile: https://share.firefox.dev/4ol5PXT (110s)
Chrome: https://share.firefox.dev/48RAlUm (1.5s)

This is probably because of the PersistentRooted collections in JSContext used for the microtask queue. These are always a risk for causing quadratic behaviour. To fix this we could change the microtask queues to use TracebleFifo<HeapPtr<Value>> (to put nursery values into the store buffer) and trace the queues in JSContext::trace, but only if we're not doing a minor GC.

Severity: -- → N/A
Priority: -- → P3

this testcase is kinda silly. Feel free to wontfix.

Assignee: nobody → mgaudet
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 146 Branch

Testcase1: https://share.firefox.dev/491RV8e (9.5s + 0.5s cleanup)
Testcase2: https://share.firefox.dev/4oW0ead (13s)

QA Whiteboard: [qa-triage-done-c147/b146]

We're going to back the solution to this out (See Bug 2002849), and re-open this bug. We'd like to get to a better solution, but for now the performance impact of this on JS3 was too high.

Oh, right, and I'll clone this bug rather than re-open it.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Status: REOPENED → RESOLVED
Closed: 7 months ago7 months ago
Resolution: --- → FIXED
Blocks: 2002852
See Also: → 2032653
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: