winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Shell extension performance issue

Open nikita-leontiev opened this issue 2 months ago • 4 comments

Extension reads all HDROP format data, although if the number of items exceeds 3, menu item is disabled, so there is no need to read HDROP if it contains more than 3 items. With a large number of items, HDROP reading can take a long time, which will slow down context menu opening.

WinMerge 2.16.50.2 x64

nikita-leontiev avatar Oct 24 '25 06:10 nikita-leontiev

Thank you for reporting this issue. Could you please tell us approximately how many files were selected when you noticed the slowdown in the context menu?

sdottaka avatar Oct 25 '25 11:10 sdottaka

Context menu opening results:

w/out ShellExtensionX64.dll with ShellExtensionX64.dll
10k items 1.6 sec 4.3 sec
50k items 8.5 sec 82.8 sec

nikita-leontiev avatar Oct 27 '25 06:10 nikita-leontiev

I created 50,000 files in the same folder and opened the context menu after selecting them, but I didn’t notice any significant slowdown. Are you perhaps using an HDD instead of an SSD?

For now, I’ve made a fix in commit a076253.

sdottaka avatar Oct 27 '25 13:10 sdottaka

I assume that you used Explorer for testing. Explorer calls IShellFolder::GetUIObjectOf with one item to get IContextMenu interface, even if several items are selected. You need to use file manager that will query IContextMenu for all selected items. I used CDefFolderMenu_Create2 to populate context menu for several items.

nikita-leontiev avatar Oct 28 '25 23:10 nikita-leontiev