smontanari / code-forensics

A toolset for code analysis and report visualisation
383 stars 45 forks source link

Request for feedback on concurrency/parallelism #38

Closed smontanari closed 5 years ago

smontanari commented 5 years ago

It would be great if any of you who are using code-forensics can provide me with some feedback on a particular feature of the program: the control of the level of parallelism (see the configuration).

When I envisioned such feature I had in mind the idea of running code-forensics without maxing out my CPU so my laptop wouldn't necessarily freeze or significantly slow down. So I tried to control the number of parallel processes that code-forensics would trigger by setting a max limit. Unfortunately this feature does not work perfectly, that is while it does somewhat help to reduce the total number of running processes, it doesn't allow a precise control. This is partly because of the streaming APIs of NodeJS (that I use to allow the processing of potentially large amount of data), so, for instance, even if I limit the parallelism to 1, running an analysis over a single time period may still require to spawn several calls to other programs (git, codemaat, ruby etc.) because the data has to be streamed from one program to another in order to be processed. This results in more than one actual process running in the background, and sort of makes the use of the max-concurrency feature not as effective or predictable.

The code behind such feature adds a bit of complexity and it's not easy to test, and I've been considering a refactoring or its altogether removal to simplify maintenance.

Therefore I have a couple of questions survey for you:

Thanks in advance to all of you helping me out with this

smontanari commented 5 years ago

I've decided to refactor and simplify the parallel execution logic. Details in the changelog for version 2.1.0 and in the wiki documentation.