actions / checkout

Action for checking out a repo
https://github.com/features/actions
MIT License
5.73k stars 1.69k forks source link

Windows checkout abysmally slow compared to Linux #1293

Open maxgerhardt opened 1 year ago

maxgerhardt commented 1 year ago

A simple

    steps:
    - uses: actions/checkout@v3

Is taking 44 seconds on Windows Server 2022 (windows-latest), while it takes 1 second on Linux (ubuntu-latest). That's 44 times slower.

See run here.

Something can't be right here. It's taking an extraordinarily long time between the start and the first "Syncing repository" message and a whopping 5 seconds to do a git init which should be almost instant.

Since https://github.com/actions/checkout/pull/1246 got merged and I am specifying checkout@v3 to get the latest v3 version, it should not be that issue. https://github.com/actions/checkout/issues/1186 does not apply because it's about Windows Server 2019.

Windows: grafik

Linux: grafik

fhammerl commented 1 year ago

@maxgerhardt Thanks for reporting this. Is checkout on windows-latest this slow every time or is it intermittent? I forked your repo and ran the same workflow, but checkout ran under 10s consistently.

maxgerhardt commented 1 year ago

I had two runs at the time of report and they were both 1m53s each (so both slow). I will rerun now.

maxgerhardt commented 1 year ago

The first 2 runs were <10 seconds, the third run again took 1m25s for the checkout :(

image

https://github.com/Community-PIO-CH32V/ch32v003fun/actions/runs/4707304404/jobs/8377094057

coderkevdev commented 1 year ago

I am experiencing this as well. Moved our self-hosted Windows runner to an EC2 from an AZR VM, and the checkout went from ~4s to 1m30s. The EC2 runner instance checkout seems to be having an issue checking the version, so it falls back to the REST API: wf_new.txt Where the previous AZR runner instance sees the version and uses git directly: wf_old.txt

Both machines have git 2.38 installed and visible in the path:

C:>git --version git version 2.38.1.windows.1

wojpawlik commented 1 year ago

I've also experienced a 90s checkout on Windows: https://github.com/fromdeno/deno2node/actions/runs/4612411694/jobs/8153276508 (https://github.com/fromdeno/deno2node/pull/39)

PureKrome commented 1 year ago

Not sure if this is related .. but .. windows machines show woeful I/O compared to their linux versions. I'm not suggesting this is an OS issue but maybe the infrastructure/hardware/I/O allocated to windows is subpar compared to those allocated to linux. (not sure about mac images).

this was detected when comparing nuget restore command (aka. download all the packages that this application requires). On windows images is was substantially slower.

So maybe that's the case here, also? It's an I/O / hardware problem?

Glitch31415 commented 1 month ago

i don't know if it's related, but my project uses a lot of git-related actions often, and it works fine in linux but when i tried to move it over to a windows pc it was unbearably slow and unable to do anything, no matter the hardware.

something i noticed, though: windows running in a vm on a linux host is perfectly fine