Slackbot
03/05/2022, 10:47 PMCharles Korn
03/05/2022, 10:47 PMCharles Korn
03/05/2022, 10:48 PMextractGolang
task to start immediately after the downloadGolang
and verifyGolangChecksum
tasks complete, but it seems to be waiting for the extractZig
task to complete.Charles Korn
03/05/2022, 10:49 PMephemient
03/05/2022, 10:54 PMCharles Korn
03/05/2022, 11:44 PMSync
task doesn’t use a worker? Unfortunately I’m using a plugin that is not yet compatible with the configuration cache, so that’s not an option for me.Fleshgrinder
03/06/2022, 9:05 AMCharles Korn
03/06/2022, 9:40 PMSync
to expand a .tar.gz
archive.
Using tar
on the command line, this takes 3-4 seconds.
Using Gradle’s Sync
takes close to 90s.
Any idea what might be causing this?Fleshgrinder
03/06/2022, 10:08 PMdoLast
?ephemient
03/07/2022, 7:02 AMCopy
instead of Sync
, which would leave out some of the processing. but still, 2x or 3x would be believable, 30x feels unreasonable. I assume you're doing something like
sync {
from(tarTree("..."))
into("...")
}
? I wonder if Gradle is expanding the tarTree multiple times for some reason… that would be unfortunate 😞Charles Korn
03/07/2022, 7:17 AMtar xf …
and using doLast { sync { ... } }
produce similar results (~3s on my machine), using Sync
takes ~86s.
I’ve created a sample project that demonstrates the issue: https://github.com/charleskorn/gradle-extract-performance-issue
Here’s a sample build scan: https://scans.gradle.com/s/7sroga3pjcv46Anze Sodja
03/07/2022, 10:11 AMextractWithSync
(cca. same as all other options on my machine) and after that it’s instant since it’s up to date. Maybe you can also try with doNotTrackState("")
for Sync
task, but in that case task it will never be up-to-date
. You can also try to run it with --no-watch-fs
but I doubt it will help in that case.
Do you have M1 Mac or some special disk setup?ephemient
03/07/2022, 10:37 AMtarTree
goes through build/tmp/expandedArchives/**
before Sync
picks it up, but it's within a factor of 2x which is not surprising. possibly you have some sort of virus scanning software on your machine that is causing very slow I/O?Charles Korn
03/07/2022, 9:47 PMMaybe you can also try withThis significantly improves things for me -fordoNotTrackState("")
taskSync
Sync
now runs in roughly the same time as the other options for a clean build (ie. empty destination directory) - scan. However, on an unclean build, it still takes just as long (as does the doLast
implementation) - scan.
Do you have M1 Mac or some special disk setup?Yep, I’m using an M1 Mac.
possibly you have some sort of virus scanning software on your machine that is causing very slow I/O?This looks like it could be the culprit - temporarily disabling the anti-virus software on my machine results in the same fast speed for both clean and unclean builds. Working with it disabled isn’t really an option though - is there anything I can do to mitigate this from the Gradle side? (apart from praying to the anti-virus gods that we move away from Sophos soon 😄)
Charles Korn
03/07/2022, 9:48 PMephemient
03/07/2022, 9:49 PMephemient
03/07/2022, 9:51 PM