Skip to content

Commit

Permalink
refactor: replaces 'glob' with 'picomatch' (#841)
Browse files Browse the repository at this point in the history
## Description

- replaces `glob` with `picomatch`

This PR makes use of the fact that dependency-cruiser just dropped
support for node 16 and 19, using nodejs >=18.17 feature -
`readdirSync`'s `recursive` option.

## Motivation and Context

See #839 reduces number of external dependencies, which reduces both security risks, maintenance effort and install size. Not the goal of this exercise, but it also reduces the start-up time and the execution speed of the gatherInitialSources step:

Not the goal of this exercise, but good to know: the execution speed
seems to have a bit improved over the previous situation:

|test|glob|picomatch|
|--    |-- |--
| `npm test -f "[I] extract/gatherInitialSources"` as measured by mocha
| 70ms | 43ms
| gatherInitialSources step in `node ./bin/dependency-cruise.mjs
--no-cache -Tnull 'src/**'` ('real' time)| 39ms | 24ms
| gatherInitialSources step in `node ./bin/dependency-cruise.mjs
--no-cache -Tnull src` ('real' time)| 14ms | 8ms
| nodejs starting step ('loading external modules') in `node
./bin/dependency-cruise.mjs --no-cache -Tnull 'src/**'` ('real' time)|
340ms | 326ms

> all averages over ~5 runs, on a quiet old mac (2,6 GHz Quad-Core Intel
Core i7)

## How Has This Been Tested?

- [x] green ci

## Types of changes

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] Documentation only change
- [x] 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)
  • Loading branch information
sverweij committed Sep 23, 2023
1 parent 6cb8e8e commit 5b6c48f
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 291 deletions.

0 comments on commit 5b6c48f

Please sign in to comment.