The Computer Language
Benchmarks Game

Perl versus PHP fastest programs

Always look at the source code.

These are only the fastest programs. Look at the other programs. They may seem more-like a fair comparison to you.

reverse-complement
source secs mem gz busy cpu load
Perl 6.35 1,495,212 287 6.54 100% 2% 0% 0%
PHP 7.30 508,064 438 11.41 2% 30% 55% 69%
spectral-norm
source secs mem gz busy cpu load
Perl 25.68 12,092 555 101.06 98% 99% 98% 98%
PHP 17.84 24,120 1152 71.08 100% 100% 100% 100%
k-nucleotide
source secs mem gz busy cpu load
Perl 37.86 1,253,064 652 132.61 84% 95% 87% 85%
PHP 24.68 215,640 1079 88.67 93% 81% 96% 89%
n-body
source secs mem gz busy cpu load
Perl 411.70 6,564 1429 435.04 2% 2% 55% 47%
PHP 221.47 7,836 1082 226.63 1% 100% 1% 1%
fasta
source secs mem gz busy cpu load
Perl 61.34 55,252 871 61.71 0% 0% 100% 0%
PHP 32.86 8,004 1062 33.02 0% 100% 0% 0%
pidigits
source secs mem gz busy cpu load
Perl 1.89 8,344 261 1.90 100% 1% 0% 0%
PHP 0.99 9,116 399 1.01 1% 0% 1% 100%
fannkuch-redux
source secs mem gz busy cpu load
Perl 395.61 12,132 570 1,576.97 100% 99% 100% 100%
PHP 129.48 22,468 1160 514.90 99% 99% 100% 99%
binary-trees
source secs mem gz busy cpu load
Perl 84.89 2,519,528 761 309.94 98% 91% 88% 88%
PHP 26.46 1,584,464 751 96.13 85% 97% 91% 90%
regex-redux
source secs mem gz busy cpu load
Perl 9.99 156,124 820 29.82 51% 96% 61% 91%
PHP 1.71 271,952 816 3.50 37% 75% 43% 50%
mandelbrot
source secs mem gz busy cpu load
Perl 532.78 43,996 586 2,130.59 100% 100% 100% 100%
PHP 73.71 123,856 875 294.40 100% 100% 100% 100%
Perl

This is perl 5, version 32, subversion 0 (v5.32.0)
built for x86_64-linux-thread-multi

PHP

PHP 7.4.7 (cli) (built: Jun 25 2020 16:42:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies