Last Comment Bug 722315 - Increase Firefox startup speed by ~5% (-76ms) on Windows by lazy loading CLSID_DragDropHelper
: Increase Firefox startup speed by ~5% (-76ms) on Windows by lazy loading CLSI...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Widget: Win32 (show other bugs)
: unspecified
: x86_64 Windows 7
: -- normal (vote)
: mozilla13
Assigned To: Brian R. Bondy [:bbondy]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-30 07:21 PST by Brian R. Bondy [:bbondy]
Modified: 2012-02-02 08:08 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1. (5.32 KB, patch)
2012-01-30 07:21 PST, Brian R. Bondy [:bbondy]
jmathies: review+
Details | Diff | Splinter Review

Description Brian R. Bondy [:bbondy] 2012-01-30 07:21:53 PST
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.
Comment 1 Kyle Huey [:khuey] (Exited; not receiving bugmail, email if necessary) 2012-01-30 07:33:33 PST
Nice.
Comment 2 Brian R. Bondy [:bbondy] 2012-02-01 06:32:27 PST
http://hg.mozilla.org/integration/mozilla-inbound/rev/740c10e98e7c
Comment 3 Ed Morley [:emorley] 2012-02-02 08:08:24 PST
https://hg.mozilla.org/mozilla-central/rev/740c10e98e7c

Note You need to log in before you can comment on or make changes to this bug.