Skip to content

perf(pnpm-install): use the runner's local disk for temp files on Windows - #41

Open
B4nan wants to merge 1 commit into
mainfrom
perf/windows-fast-temp-dir
Open

B4nan wants to merge 1 commit into
mainfrom
perf/windows-fast-temp-dir

Conversation

@B4nan

@B4nan B4nan commented Sep 10, 2026

Copy link
Copy Markdown
Member

On Windows runners, pnpm-install now sets TMP and TEMP to RUNNER_TEMP for the rest of the job. The default temp dir is on a network-backed disk that is 4-6x slower at small-file writes than the runner's local SSD, so unpacking a project or a node_modules tree there costs that much per file. apify/actor-templates#907 measured it: the same step took the Windows legs from ~20m to ~11m. Nothing changes on Linux or macOS.

Every JS repo calls this action first, so any Windows leg added later gets this for free. actor-templates can drop its own copy of the step once it bumps to a release with this change.

The README also says to gate playwright install --with-deps on Linux. On Windows the flag installs the Media Foundation feature, which takes about three minutes and only adds video codecs.

…dows

The default Windows temp dir sits on a network-backed disk that is 4-6x
slower at small-file writes than the local SSD behind RUNNER_TEMP.
Pointing TMP/TEMP there for the rest of the job removes that cost for
anything that unpacks many files into the temp dir. Measured on
apify/actor-templates#907, where it took the Windows legs from ~20m to
~11m. No-op on Linux and macOS.

Also documents gating playwright's --with-deps on Linux: on Windows the
flag installs the Media Foundation feature, ~3 minutes per job.
@B4nan B4nan added the adhoc Ad-hoc unplanned task added during the sprint. label Sep 10, 2026
@B4nan B4nan added the t-tooling Issues with this label are in the ownership of the tooling team. label Sep 10, 2026
B4nan added a commit to apify/workflows that referenced this pull request Sep 13, 2026
…n Windows (#323)

On Windows runners, `python_unit_tests` now sets `TMP` and `TEMP` to
`RUNNER_TEMP` for the rest of the job. The default temp dir is on a
network-backed disk that is 4-6x slower at small-file writes than the
runner's local SSD. pytest's `tmp_path` and uv's scratch files both
honor `TEMP`, so they land on the fast disk. Measured in
apify/actor-templates#907. Nothing changes on Linux or macOS.

This workflow runs the Windows legs of crawlee-python, apify-sdk-python,
apify-client-python and apify-shared-python. apify/actions#41 is the
same change for the pnpm side.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants