llaville / php-compatinfo

Library that find out the minimum version and the extensions required for a piece of code to run
https://llaville.github.io/php-compatinfo/7.1/
Other
371 stars 21 forks source link

Multicore support #355

Open yuri-ccp opened 2 years ago

yuri-ccp commented 2 years ago

New Feature request

Multicore support

Summary

Currently many PHP systems increases in size. Each day more and more modular systems are made with many different libs and files. Not only each PHP version increases the comparison range and DB size of compatinfo. Even with the phpCompatInfo using 100% o a CPU this requires a lot time to scan those complex systems. One good solution to improve the scan time is to allow the phpCompatInfo to scan different files with different CPUs at same time then sumarize all then together.

Description

I'm not an expert in PHP to correctly describe how to do this exactly but maybe can be possible to divide the file list to scan during analyzer run in different queues equals to the currently available cores of the server and then use pcntl functions to paralelize the scan making one scanner for each queue. Other option is put all files in a stack and make the master process to distribute them between a number of threads equal to number of available CPUs.

This can improve the scan time a lot specially in servers with a large number o CPUs.

llaville commented 2 years ago

It's a good proposal but it requires a lot of work, and I've actually few free time ! Perharps later in next months but I cannot schedule a date