pivotal / LicenseFinder

Find licenses for your project's dependencies.
MIT License
1.72k stars 339 forks source link

Speed up Cargo license finder #1011

Closed seanlinsley closed 8 months ago

seanlinsley commented 9 months ago

The current implementation uses a recursive ** glob, which is very slow on our application. time ls ~/.cargo/registry/src/**/ahash-0.8.6 for example takes 1.8 seconds for a single package.

Changing it to use * improves bundle exec license_finder runtime from several minutes (at least) to 28 seconds.

I don't think the ** was needed: the path includes a folder for every Cargo registry, immediately followed by a folder for each crate.

pivotal-cla commented 9 months ago

@seanlinsley Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

cf-gitbot commented 9 months ago

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

seanlinsley commented 9 months ago

This might be considered an obvious fix. Let me know if signing the CLA is actually needed here.