Open Bug 1570613 Opened 6 years ago Updated 3 years ago

::RegisterDragDrop does main thread I/O during startup

Categories

(Core :: Widget: Win32, task, P3)

task

Tracking

()

Performance Impact low

People

(Reporter: florian, Unassigned)

References

Details

(Keywords: main-thread-io, perf:startup, Whiteboard: [fxperfsize:L])

In bug 1362382, ::RegisterDragDrop was moved to be done off the idle queue. Unfortunately, this can still happen before first paint, as can be seen in this startup profile: https://perfht.ml/2Zokru4

It looks like most of the cost is CoCreateInstance from combase.dll calling StgDatabase::InitDatabase (from clbcatq.dll) which opens the C:\WINDOWS\Registration\R00000000000d.clb and C:\WINDOWS\Registration\R000000000001.clb files several times on the main thread.

I wonder if this database initialization could be done off main thread. If not, it would be nice to delay the ::RegisterDragDrop call until after first paint.

See Also: → 1570616

Mirroring the priority from the linked bug 1570616. Note that the reason this is still happening before firstpaint may also be related to the time limit that we set on the idle task (of 1 second) which may force it to be executed when we're not idle at all.

I expect that to fix this, we'd want to move the creation of the task to a point where it happens after the initial paint. The downside there is that there may be some short time after the initial paint and before this code runs where drag/drop doesn't work correctly. I don't know how acceptable that would be...

There's some other background in bug 1570616. Either way, this doesn't look trivial.

Whiteboard: [fxperf] → [fxperf:p2][fxperfsize:L]
Performance Impact: --- → ?
Whiteboard: [fxperf:p2][fxperfsize:L] → [fxperfsize:L]

Hey Florian,

do you think this bug is still current? Maybe you could help record a new profile showing this problem?
Thanks!

Flags: needinfo?(florian)
Performance Impact: ? → P3

(In reply to Julien Wajsberg [:julienw] from comment #2)

do you think this bug is still current? Maybe you could help record a new profile showing this problem?

I can't reproduce on my current Windows machine. It seems CoCreateInstance doesn't read "C:\WINDOWS\Registration\R000000000001.clb", and instead uses data from the Windows registry.

I wonder if it happens only on some machines, or if it has been fixed by a newer version of Windows 10.

Flags: needinfo?(florian)
Severity: normal → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.