simonrenoult / code-complexity

Measure the churn/complexity ratio. Higher values mean hotspots where refactorings should happen.
MIT License
281 stars 28 forks source link

Proposal: Increase buffer size for execSync call #39

Closed alexdo closed 2 years ago

alexdo commented 2 years ago

I'm using code-complexity against a large monorepo at work and am running into ENOBUFS errors, even when using since and until flags for < 4 weeks. Some statistics about the monorepo: 6 years old, 120k commits, ~500k SLOC in TS, ~30k files currently on master.

The until flag was added as a kind of workaround for this issue in #29. I noticed the possibility to increase the buffer size via execSync options (defaults to 1MB; this PR proposes 32MB)

A buffer size of 32MB is enough to fit the complete history into one code-complexity command (neither since or util flags are necessary). code-complexity runs for ~13s on my M1 Mac.

Was there any specific reason for you to avoid increasing the buffer size and opting for until instead? What do you think about increasing it?

Thank you for your work on code-complexity – it's a really nice tool! 💯 ❤️

simonrenoult commented 2 years ago

Hi @alexdo

Sorry for the delayed response :sweat_smile:

Was there any specific reason for you to avoid increasing the buffer size and opting for until instead?

Definitely an oversight on my part, I didn't RTFM enough! Thanks for the suggestion, I just released a version with a max buffer of 32M which should be enough, as you suggested :+1:

Sorry I didn't accept your PR, I was working on the project and directly added it to the code base. As a compensation, I added your name to the brand new Special thanks section (aka "Section for people I steal code from by excess of enthusiasm").

Thank you for your work on code-complexity – it's a really nice tool! 100 heart

Thanks for the kind words, means a lot <3