Created attachment 592708 [details] [diff] [review]
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.