question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Restoring cache on MacOS is extremely slow

See original GitHub issue

I figured out restoring the cache is very slow on MacOS. I have created a test case with some node_modules for a React Native application. The following action is used:

uses: actions/cache@v2
with:
    path: 'node_modules'
    key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}

Here are the results:

Restoring on ubuntu: Test run 1 took 6s: https://github.com/andrmoel/github-actions-speed-test/runs/3476428716?check_suite_focus=true Test run 2 took 8s: https://github.com/andrmoel/github-actions-speed-test/runs/3476523783?check_suite_focus=true

Restoring on macos: Test run 1 took 3m25s: https://github.com/andrmoel/github-actions-speed-test/runs/3476430657?check_suite_focus=true Test run 2 took 24s: https://github.com/andrmoel/github-actions-speed-test/runs/3476523785?check_suite_focus=true

In the best case restoring the cache on MacOS takes 3 times longer than on ubuntu. But what really makes me worry are the 3m25s from MacOS test run number 1.

Edit: I did some research on another repository and I assume the long action happens every time when the cache was hit the first time.

I have created a test repository with two identical github-actions. One action runs on ubuntu-latest the other one on macos-latest

https://github.com/andrmoel/github-actions-speed-test

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Mattijahcommented, Mar 31, 2022

I’m having the same issue on MacOS. It was taking over 27 minutes to decompress 1.2 GB and it still wasn’t done, so I cancelled it. This isn’t unacceptable. I’m using actions/cache@v3 and macos-11.

0reactions
penchefcommented, Dec 1, 2022

@pdotl I’m seeing the same issue.

this repo contains a reproducible workflow

MacOS is consistently much slower than linux: Screen Shot 2022-11-30 at 20 26 41 Screen Shot 2022-11-30 at 20 26 34 Screen Shot 2022-11-30 at 20 26 26

I’ve also observed this many times in an real world environment of the same dependencies (notice the same hash in both runs 8f697dca40e59245771bc3babd61ce7eec68e51d1af2f99a79dff601c742dfe4):

linux: 30sec

Screen Shot 2022-11-30 at 20 30 28

macOS: 2:10min

Screen Shot 2022-11-30 at 20 30 39
name: Slow cache example
on:
  workflow_dispatch:
  push:
  pull_request:

jobs:
  generate:
    name: generate
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: generate large file to cache
        run: dd if=/dev/urandom of=some-large-file bs=1M count=500
      - name: cache large file
        uses: actions/cache@v3
        with:
          path: some-large-file
          key: ${{ hashFiles('some-large-file') }}
  restore-linux:
    name:  restore-linux
    needs: generate
    runs-on: ubuntu-latest
    steps:
      - name: restore cached large file
        uses: actions/cache@v3
        with:
          path: some-large-file
          key: large-file
  restore-macos:
    name:  restore-macos
    needs: generate
    runs-on: macos-12
    steps:
      - name: restore cached large file
        uses: actions/cache@v3
        with:
          path: some-large-file
          key: large-file
Read more comments on GitHub >

github_iconTop Results From Across the Web

Computer has been extremely slow even after deleting cache ...
Repair the disk by booting from the Recovery HD. Immediately after the chime hold down the Command and R keys until the Utility...
Read more >
Mac is slow! Easy Fixes in 2023 - EaseUS
How to fix a slow Mac - [Software aspect] · 1. Choose Go > Utilities. · 2. Double-click Disk Utility. · 3. Select...
Read more >
How to Clear Cache on mac For Optimized Performance [2022]
Clearing cache on your Mac can make it run a lot faster and smoother. So, in this guide, we have compiled some of...
Read more >
How to Fix a Slow Mac - Tips to Speed Up a Mac | Nektony
Detect and close memory-consuming apps · Launch Activity Monitor. · Click View in the Menu Bar and select Windowed Processes. · Click the...
Read more >
How to Fix Slow Mac After macOS Ventura Update
1. macOS slow right after an update · 2. Use Activity Monitor to kill apps and background tasks · 3. Disable Stage Manager....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found