[ 
https://issues.apache.org/jira/browse/MCLEAN-102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17897271#comment-17897271
 ] 

Peter De Maeyer commented on MCLEAN-102:
----------------------------------------

There is not much to go on in this issue to effectively root-cause this, but 
let's see if we can hypothesize as to what _might_ be a root cause.

Looking at the code {{Cleaner.delete}}, {{fast}} mode together with 
{{includes/excludes}} could have a performance impact. As soon as a file is 
excluded from a directory, it will cause the {{parentDir.delete}} to fail 
because the dir is obviously not empty, which will result in a {{System.gc()}} 
on Windows + 3 retries with back-off delays of 50 + 250 + 750 milliseconds, 
only to fail 3 times over again for the same reason. Depending on 
{{failOnError}} this will actually fail the build or not, but in any case it 
will cause an unnecessary delay. This could be fixed, by rewriting the 
{{Cleaner}} to leverage {{Files.walkFileTree(Path, FileVisitor)}} + being 
smarter about when to (not) delete a directory. MCLEAN-126 won't fix it, but is 
a prerequisite first step towards improving this.

> Fast is slower on windows with many cores
> -----------------------------------------
>
>                 Key: MCLEAN-102
>                 URL: https://issues.apache.org/jira/browse/MCLEAN-102
>             Project: Maven Clean Plugin
>          Issue Type: Bug
>    Affects Versions: 3.2.0
>         Environment: Windows 10
>            Reporter: Delany
>            Priority: Major
>
> I run a 500+ module project with 4 core Linux and experience a 20sec 
> improvement in reactor build time when enabling the fast.
> My one colleagues runs the same build with 4 cores on Windows and also sees 
> an improvement.
> But two other colleagues run the same build with 12 cores on Windows (one 
> uses cygwin, the other powershell) and they consistently see a slowdown from 
> 2:14 to 3:23, for example.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to