-
Notifications
You must be signed in to change notification settings - Fork 73
Description
So this is something I noticed today, see the full conversation on Astral's Discord starting here: https://discord.com/channels/1039017663004942429/1207998321562619954/1430650522452627658
The following:
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
activate-environment: trueTakes 2-4s on ubuntu-latest runner, and usually takes 13-25s on windows-2022.
This is even slower than just using actions/setup-python, which usually takes 6-18s on good runs (there's some random 52-65s runs, but it averages out).
Example from the worst run I noticed (an outlier at 34s total): https://github.com/Avasam/pywin32/actions/runs/18727630500/job/53416263434?pr=16#step:3:35
Just downloading/installing uv took ~27s there. In most runs that takes ~10-20s
Creating a venv takes 3-5s, https://github.com/Avasam/pywin32/actions/runs/18727630500/job/53416263358?pr=16#step:3:45. As @zanieb mentioned on Discord, creating a venv ought to be in the realm of ms.
A run I did on ubuntu-latest for comparison: https://github.com/Avasam/pywin32/actions/runs/18729764144/job/53423658922?pr=16#step:3:36
Not sure if it's just the GitHub Windows runners being really awful, but I figured I'd share my findings in a proper issue. Maybe it's possible to optimize something for that environment.
There was some mentions about parallelizing some steps like listing the Python environments.
Zanie also mentioned using Windows Dev Drives, I'm not familiar enough to set one up to work with uv yet. But maybe that's also worth recommending to improve uv's performance on GitHub-hosted Windows runners.