The Computer Language
22.01 Benchmarks Game

Perl versus PHP fastest programs

Always look at the source code. These are only the fastest programs.

If they are manually vectorized SIMD, does the host language matter? You might not be interested in the most optimised programs.

Look at "mandelbrot" or "spectral-norm" or other measurement tables. Look at the other programs. Choose which programs you want to compare.

reverse-complement
source secs mem gz busy cpu load
Perl 6.47 1,495,076 287 6.53 0% 0% 100% 1%
PHP 6.96 536,328 446 11.04 48% 6% 32% 73%
pidigits
source secs mem gz busy cpu load
Perl 1.84 8,416 261 1.89 100% 2% 1% 1%
PHP 0.92 14,236 399 0.93 0% 100% 1% 0%
k-nucleotide
source secs mem gz busy cpu load
Perl 41.45 1,253,564 652 146.71 92% 84% 86% 91%
PHP 19.76 255,072 1079 67.84 96% 76% 96% 76%
fasta
source secs mem gz busy cpu load
Perl 62.96 55,196 871 65.41 2% 1% 2% 100%
PHP 20.77 13,076 1062 21.01 1% 0% 0% 100%
binary-trees
source secs mem gz busy cpu load
Perl 54.12 1,048,528 797 200.52 90% 90% 100% 90%
PHP 17.82 1,589,760 760 63.91 89% 89% 96% 84%
spectral-norm
source secs mem gz busy cpu load
Perl 23.53 12,208 555 92.94 99% 99% 98% 99%
PHP 7.03 37,884 1152 27.90 99% 99% 99% 99%
regex-redux
source secs mem gz busy cpu load
Perl 9.84 157,208 820 29.65 96% 64% 91% 51%
PHP 1.83 189,236 816 3.65 36% 35% 88% 41%
fannkuch-redux
source secs mem gz busy cpu load
Perl 412.79 12,036 570 1,649.45 100% 100% 100% 100%
PHP 57.71 46,568 1162 228.98 100% 99% 99% 99%
n-body
source secs mem gz busy cpu load
Perl 481.13 6,268 1429 484.16 0% 0% 0% 100%
PHP 65.72 12,940 1082 66.13 0% 100% 0% 0%
mandelbrot
source secs mem gz busy cpu load
Perl 469.56 56,268 586 1,877.72 100% 100% 100% 100%
PHP 23.26 142,252 875 92.82 100% 100% 100% 100%
Perl

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

PHP

PHP 8.1.1 (cli) (built: Jan 6 2022 19:24:43) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.1, Copyright (c) Zend Technologies