zumwald / oss-attribution-generator

utility to parse bower and npm packages used in a project and generate an attribution file to include in your product
MIT License
37 stars 23 forks source link

Async file access code with synchronous one replaced #17

Closed Marcel-Lambacher closed 6 years ago

Marcel-Lambacher commented 6 years ago

If I run oss-attribution-generator the generation of the attribution overview took more than 25 minutes. In a quick research I found out that this code often handles file access asynchronously. This caused to very high disk load.

I've replaced all this asynchronous code with synchronous one. This applies to all areas in getNpmLicenses() and getBowerLicenses() where the following methods was used:

After the integration of the synchronous code, I could reduce the generation time from 25 minutes to 2 minutes.

Tested on: Windows 10 Enterprise x64bit (Build 1703) Node v8.9.4

zumwald commented 6 years ago

Benchmarked this on a sample project vs. master and it yielded ~75% reduction in execution time. Nice! Reviewing the code changes now.