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.36 1,495,132 287 6.52 0% 0% 2% 100%
PHP 7.06 534,336 446 11.90 14% 49% 40% 65%
k-nucleotide
source secs mem gz busy cpu load
Perl 37.72 1,255,884 652 131.45 88% 89% 87% 85%
PHP 20.15 254,792 1079 69.22 91% 96% 80% 76%
pidigits
source secs mem gz busy cpu load
Perl 1.90 8,268 261 2.16 100% 2% 3% 9%
PHP 0.91 13,196 399 0.96 2% 0% 3% 100%
fasta
source secs mem gz busy cpu load
Perl 58.08 55,188 871 59.16 1% 100% 1% 0%
PHP 22.82 12,356 1062 24.32 3% 2% 2% 100%
binary-trees
source secs mem gz busy cpu load
Perl 53.02 1,048,568 797 195.75 91% 88% 100% 90%
PHP 18.64 1,588,704 760 67.29 89% 90% 96% 86%
spectral-norm
source secs mem gz busy cpu load
Perl 24.69 12,188 555 96.59 97% 99% 98% 97%
PHP 7.51 35,364 1152 29.55 99% 98% 98% 98%
n-body
source secs mem gz busy cpu load
Perl 419.75 6,388 1429 429.50 1% 1% 1% 100%
PHP 71.75 12,072 1082 76.86 3% 1% 2% 100%
regex-redux
source secs mem gz busy cpu load
Perl 10.10 157,208 820 31.98 96% 67% 93% 61%
PHP 1.73 162,348 816 3.58 37% 88% 44% 39%
fannkuch-redux
source secs mem gz busy cpu load
Perl 392.54 12,116 570 1,568.84 100% 100% 100% 100%
PHP 63.18 44,168 1160 250.98 99% 99% 100% 99%
mandelbrot
source secs mem gz busy cpu load
Perl 542.82 45,036 586 2,169.30 100% 100% 100% 100%
PHP 24.89 135,480 875 99.12 100% 100% 99% 100%
Perl

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

PHP

PHP 8.0.0 (cli) (built: Nov 26 2020 09:02:29) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies