Skip to content

Cache is slow if tar file is stored #174

Description

@koleksiuk

In our test case one of the steps involves caching a docker image into the file and restoring it later.

Problem is, if we cache a tar file, the script will compress it which is a time-consuming operation which doesn't really bring a big value.

Default cache command, provided by semaphore:

semaphore@semaphore-vm:~/app_cache_dir$ time tar czPf /tmp/app_image_cache-cac3c3500fc4aa1a4f8dece0edb86e57ad36510e.tar app-image.tar 
real	0m34.813s
user	0m33.855s
sys	0m1.230s

without compression:

semaphore@semaphore-vm:~/app_cache_dir$ time tar cPf /tmp/app_image_cache-cac3c3500fc4aa1a4f8dece0edb86e57ad36510e.2.tar app-image.tar 
real	0m0.708s
user	0m0.049s
sys	0m0.655s

The possible solution would be to provide a flag option to cache, like: cache store --compress=false my_file_or_directory which would add or remove z option from tar command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions