spdx / Spdx-Java-Library

Java library which implements the Java object model for SPDX and provides useful helper functions
Apache License 2.0
32 stars 33 forks source link

Implement a quick find regex for license matching #225

Closed goneall closed 5 months ago

goneall commented 5 months ago

Potential fix for #165

It seems to speed things up - not quite fast enough to get rid of the "slow tests" flags, but a noticeable improvement.

@pmonks - review / give it a try and let me know how it does. This implements the algorithm we were discussing.

pmonks commented 5 months ago

Reviewing now. Thanks for turning this around so fast @goneall!

pmonks commented 5 months ago

Ok so running my default (smaller) test suite here took almost 10 minutes with v1.1.10, and only 35 seconds with the issue165 branch. I also ran it with my full (larger) test suite (which normally takes around an hour with v1.1.10), and with the issue165 branch it took just over 2 minutes. All tests were run with pre-downloaded & cached v3.22 SPDX license list and associated assets (so the time to load those assets was negligible - less than a second each time).

All of my tests passed in each case, so functionally it appears to be working well too.

tl;dr: this is a MASSIVE performance improvement!! :tada:

goneall commented 5 months ago

@pmonks - Thanks for the review. Wow! More of an improvement than I thought. Thanks for the design suggestions.

I'll go ahead and merge it in.