Restore_cache is 2x slower on an Alpine docker image than on a Debian image

Alpine is twice as slow as Debian to restore a 138MB compressed node_modules cache into memory (/dev/shm). I’m experimenting with using an Alpine docker image because of the smaller size compared to a Debian image.

Time to restore cache on Alpine in seconds: 20, 20, 19, 22, 21, 20
Time to restore cache on Debian in seconds: 7, 7, 7, 7, 7, 9

What is the restore_cache step doing and why would it be twice as slow under Alpine?

Alpine docker file: https://github.com/jschaf/ci_speed_test/blob/master/docker/alpine-ci/Dockerfile
Debian docker file: https://github.com/jschaf/ci_speed_test/blob/master/docker/debian-ci/Dockerfile

Representative CircleCI workflows:

1 Like