MercurialEclipse dramatically slows down "clean" (perhaps especially on Windows?)
When running a "clean" operation in Eclipse, the mercurial plugin seems to dramatically slow down the "cleaning output folder" step. I first noticed this a couple years ago after an Eclipse upgrade, so I suspect the root cause was actually a change in how Eclipse itself fires "resource changed" events under the hood. Basically, I think Eclipse went from firing a small number of change events per project during a clean (like 1-10 events?) to firing a resource change event for every single compiled class file that gets deleted by the clean process (so like 1000+ events), which led to some bottlenecks in the hg plugin's change listeners?
Based on sampler data, the primary bottleneck is disk operations, which means this problem is probably significantly worse on Windows compared to other operating systems (cause NTFS sucks~).
Measurements on my machine: (Windows 10, SSD)
Duration of "Project -> Clean -> Clean All Projects":
With mercurialeclipse plugin installed: 59 sec
Without mercurialeclipse plugin installed: 5 sec
Sampler Data
I used VisualVM to sample Eclipse while the clean operation was running. The results pretty clearly identify the mercurial plugin as the culprit:
Based on the class names, it sounds like MercurialRootCache
should be caching the "HG root" to avoid repeatedly triggering expensive disk operations, but it seems like that caching may not be working properly based on the sampler results? (Perhaps each "resource changed" event ends up blowing the cache or something?)