Skip to content

feature: adds basic, experimental caching facility #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2022
Merged

Conversation

sverweij
Copy link
Owner

@sverweij sverweij commented Jul 30, 2022

Description

  • adds a new --cache cli option/ cache configuration option
  • adds a cache invalidation algorithm based on options passed to dependency-cruiser as well as files changed (as reported by git).
  • adds some new run scripts to the manifest - powered by the watskeburt package we use as a consistent interface over git.
  • disables caching for the depcruise-baseline command

This feature has been dog-fed in private & public beta's over the past weeks. Despite that the feature is marked experimental. Parts of the implementation and even interface might change when new features are added or when new insights develop.

This PR was published on npm as dependency-cruiser@11.14.0-beta-1 with
shasum 240229c9a9f8a61ac739cb95cda64f6d7b3f8fee

Motivation and Context

  • will speed up runs of dependency-cruiser that are sufficiently similar enough to serve a 100% from the cache. E.g. dependency-cruiser's self check takes ~2650ms without cache and ~850ms with cache (513 modules, 1265 dependencies, 2,6 GHz Quad-Core Intel Core i7, with an SSD of some sort). On large code bases the win is more dramatic.
  • first step to a slightly more intelligent cache that would only need to analyse the difference between cache and reality.

Visual overview of changes in src for this PR

diff

To get this graph:

node ./bin/dependency-cruise.js src \
    --config \
    --output-type dot \
    --reaches $(watskeburt develop) \
  | dot -T svg \
  > diff.svg 

How Has This Been Tested?

  • green ci
  • additional E2E, integration and unit tests

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Documentation only change
  • Refactor (non-breaking change which fixes an issue without changing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • 📖

    • My change doesn't require a documentation update, or ...
    • it does and I have updated it
  • ⚖️

    • The contribution will be subject to The MIT license, and I'm OK with that.
    • The contribution is my own original work.
    • I am ok with the stuff in CONTRIBUTING.md.

Sorry, something went wrong.

@sverweij sverweij force-pushed the feature/cache branch 12 times, most recently from 5dcc0f6 to 85ae38c Compare July 31, 2022 13:21

Verified

This commit was signed with the committer’s verified signature.
sverweij Sander Verweij
@sverweij sverweij merged commit 6e73876 into develop Jul 31, 2022
@sverweij sverweij deleted the feature/cache branch July 31, 2022 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant