Increase Firefox startup speed by ~5% (-76ms) on Windows by lazy loading CLSID_DragDropHelper

RESOLVED FIXED in mozilla13

Status

()

Core
Widget: Win32
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bbondy, Assigned: bbondy)

Tracking

unspecified
mozilla13
x86_64
Windows 7
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 592708 [details] [diff] [review]
Patch v1.

When profiling nsWindow.cpp in Windows I found that enabling drag and drop uses ~70ms on app startup.

> NAME: nsWindow::EnableDragDrop 
> Count: 3 
> Total: 0.076:01
> Min: 0.000:00
> Max: 0.076:01
> Average: 0.025:33
> App start time until first paint: 0.890:00


Upon further inspection this all comes from nsNativeDragTarget and in particular: 

> CoCreateInstance(CLSID_DragDropHelper, NULL, CLSCTX_INPROC_SERVER,
                    
>                  IID_IDropTargetHelper, (LPVOID*)&mDropTargetHelper);


mDropTargetHelper isn't needed though until a drag actually happens.
For that reason we can lazy load it instead and save the complete 76ms from startup.
Attachment #592708 - Flags: review?(jmathies)
Nice.

Updated

5 years ago
Attachment #592708 - Flags: review?(jmathies) → review+
(Assignee)

Comment 2

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/740c10e98e7c
Target Milestone: --- → mozilla13

Comment 3

5 years ago
https://hg.mozilla.org/mozilla-central/rev/740c10e98e7c
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.