kasparsd / php-7-debian

Install PHP 7 on Debian/Ubuntu
349 stars 102 forks source link

Use as many CPUs as possible #29

Closed SergeAx closed 7 years ago

SergeAx commented 8 years ago

It is a real pain to compile on ARM-machine knowing there are 3 more cores available :)

kasparsd commented 8 years ago

That is an excellent suggestion @SergeAx!

I'm now reading on the performance of -j and it appears that setting it to 2 provides the best improvement.

How about we check for 2 or more cores and then set it to -j2 instead of the actual core count?

SergeAx commented 8 years ago

I've read answers on StackOverflow from your link and it seems to me that all authors agree with my point: make performance increases linearly until number of jobs equals to number of cores.

While exploring ARM architecture I see it's strength in large numbers of cheap slow cores, so using all of them is a key to squeeze maximum performance. Memory can be an issue on systems with 16+ cores, but I believe those systems should be well equipped with RAM too.

So I would stand with my initial suggestion of using cat /proc/cpuinfo, but the final decision is certainly up to you as an author of original package.

kasparsd commented 7 years ago

Thanks @SergeAx!

kasparsd commented 7 years ago

@SergeAx You were right -- this provides a huge performance boost! Here is a screenshot of the build on Orange Pi Zero:

orange-pi-zero-php7-build