New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for parallelisation of analysis (utilise several CPUs) #2803
Comments
Hi ! In the meantime, I suggest to ensure that you are running the newest fixer under PHP 7+ with caching enabled. |
@keradus thanks! Probably php-cs-fixer could adopt in some way after the param fetching the pcntl_fork(). It duplicates the current PHP process into a child, which can then work separately from the parent process. So per process could init a parsing or rules or fixers. |
I would prefer to use threads instead of processes, using pool pattern and have solution that would provide common interface and hide parallel-implementation thus we rely on same interface regardless parallelization is possible or not. |
👍 For threads. By parallel implementation, what we really mean is, "concurrent" implementation. Just pointing out this, for when naming of classes happens. |
are any of you willing to create POC? if not, I do really doubt that it will happen soon |
👍 threads seems more suitable. I think that the POC could be built around the FixCommand just before to launch the "Runner" class with all the arguments fetched. Probably the Runner class could be in fact a thread or inherit form a Worker/Thread customized class. So a method like "Divide and Conquer" for "attack" all the files and folders in a directory given (and stop when a file parse is unique as stop condition). So a maximum_threads could be added in configuration per default. |
Since I hope this helps 😉 |
…ss files in different processes
…ss files in different processes
…ss files in different processes
…ss files in different processes
I am noticing in big php projects that run some filters will take hours (mostly when a lot config arrays are in place, for example projects that include other libs inside his source code, like tcpdf in older versions) that takes more than some hours in run the fixers. I notice that it is only using one CPU and I cannot run in parallel, unless that I split several instances in several files or folders at same time.
I would like know if there are a way that the project could accept run in parallel for several cpus (for example one CPU could take the fixer for one file and other CPU for other), so if you have 4 CPUs with 8 threads, you can "fix" 8 files per execution, more quick indeed
The text was updated successfully, but these errors were encountered: