Skip to content

Cache Use Hard/Soft Link for Instead of Copying All the Files #2688

@OGoodness

Description

@OGoodness

Description

Currently with SAM, you are able to specify a cache, which is nice. But sometimes, using that cache is actually slower than just running a regular sam build. SAM copies all the files from the cache, and then writes them in the build directory. This is a lot of I/O operations, and can take forever on old and newer computers, especially if your project runs in node.

Proposal

Instead of copying all the files directly, how about you create a symbolic or hard link to each files. This way, there will be less overhead when performing builds, no need to copy the entire file, just create a reference to the associated file.

Maybe this isn't the default way of doing it, but provide an option to do so. Maybe a parameter you can pass into the --cached parameter?

Things to consider:

  1. Speed up builds significantly
  2. Saves disk space

Additional Details

This might introduce issues where, a user decides to manually edit a hard link, and that will effect the original cache. But I think this feature would be a great optional use.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions