php-yarv.html 10.8 KB
Newer Older
Isaac Gouy's avatar
Isaac Gouy committed
1 2 3
<!DOCTYPE html>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="robots" content="all" />
Isaac Gouy's avatar
Isaac Gouy committed
4 5
<meta name="description" content="PHP Ruby - Which programs are faster?" />
<title>PHP&nbsp;vs&nbsp;Ruby - Which programs are faster? | Computer Language Benchmarks Game </title>
Isaac Gouy's avatar
Isaac Gouy committed
6
<style><!--
Isaac Gouy's avatar
Isaac Gouy committed
7
a{color:black;text-decoration:none}article,footer{padding:0 0 2.9em}article,div,footer,header{margin:auto;width:92%}body{font:100% Droid Sans, Ubuntu, Verdana, sans-serif;margin:0;-webkit-text-size-adjust:100%}h3, h1, h2, nav li a{font-family:Ubuntu Mono,Consolas,Menlo,monospace}div,footer,header{max-width:31em}h3{font-size:1.4em;font-weight:bold;margin:0;padding: .4em}h3, h3 a{color:white;background-color:#dd4814}h3 small{font-size:0.64em}h1,h2{margin:1.5em 0 0}h1{font-size:1.4em;font-weight:normal}h2{font-size:1.2em}li{display:inline-block}nav li{list-style-type:none}nav li a{display:block;font-size:1.2em;margin: .5em .5em 0;padding: .5em .5em .3em}nav ul{clear:left;margin:-0.3em 0 1.5em;padding-left:0;text-align:center}p{color:#333;line-height:1.4;margin: .3em 0 0}p a,span{border-bottom: .1em solid #333;padding-bottom: .1em}.best{font-weight:bold}.message{font-size: .8em}table{color:#333;margin:1.3em auto 0;text-align:right}tbody::after{content:"-";display:block;line-height:2.6em;visibility:hidden}tbody:last-child{text-align:left}td{border-bottom: .15em dotted #eee;padding: .7em 0 0 1em}td a, th a{display:block}td:first-child,th:first-child{text-align:left;padding-left:0}td:nth-child(6),th:nth-child(6){display:table-cell}th{font-weight:normal;padding: .7em 0 0 1em}@media only screen{th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4),th:nth-child(5),td:nth-child(5),th:nth-child(6),td:nth-child(6){display:none}h2::after{content:" (too narrow: mem, gz, cpu, cpu-load columns are hidden)";font-weight:normal;font-size: .9em}}@media only screen and (min-width: 28em){th:nth-child(3),td:nth-child(3),th:nth-child(4),td:nth-child(4),th:nth-child(5),td:nth-child(5){display:table-cell}h2::after{content:" (cpu-load column is hidden)"}}@media only screen and (min-width: 41em){th:nth-child(6),td:nth-child(6){display:table-cell}h2::after{display:none}}@media only screen and (min-width: 60em){article,footer,header{font-size:1.25em}}
Isaac Gouy's avatar
Isaac Gouy committed
8 9
--></style>
<link rel="shortcut icon" href="./favicon.ico">
Isaac Gouy's avatar
Isaac Gouy committed
10
<header>
Isaac Gouy's avatar
Isaac Gouy committed
11
  <h3><a href="https://benchmarksgame-team.pages.debian.net/benchmarksgame/">The&nbsp;<small>Computer&nbsp;Language</small><br>Benchmarks&nbsp;Game</a></h3>
Isaac Gouy's avatar
Isaac Gouy committed
12 13 14
</header>
<article>
  <div>
Isaac Gouy's avatar
Isaac Gouy committed
15
    <h1>PHP versus Ruby fastest programs</h1>
Isaac Gouy's avatar
Isaac Gouy committed
16
    <aside>
Isaac Gouy's avatar
Isaac Gouy committed
17 18 19

    <nav>
      <ul>
Isaac Gouy's avatar
Isaac Gouy committed
20 21
        <li><a href="../faster/php-node.html"><span>vs JavaScript</span></a>
        <li><a href="../faster/php.html"><span>vs Python</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
22 23 24 25
        <li class="best">vs Ruby
      </ul>
    </nav>
    </aside> 
Isaac Gouy's avatar
Isaac Gouy committed
26 27 28
  </div>
  <section>
    <div>
Isaac Gouy's avatar
Isaac Gouy committed
29
      <h2>by faster benchmark performance</h2>
Isaac Gouy's avatar
Isaac Gouy committed
30 31 32 33
    </div>
    <table>
      <tbody>
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
34
        <th colspan="3"><a href="../performance/regexredux.html"><span>regex-redux</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
35 36 37 38 39 40 41 42 43
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
44
        <td><a href="../program/regexredux-php-1.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
45 46
        <td class="best">2.61
        <td>270,552
Isaac Gouy's avatar
Isaac Gouy committed
47
        <td>816
Isaac Gouy's avatar
Isaac Gouy committed
48 49
        <td>2.44
        <td class="message">79%&nbsp;40%&nbsp;40%&nbsp;42%
Isaac Gouy's avatar
Isaac Gouy committed
50
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
51
        <td><a href="../program/regexredux-yarv-3.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
52 53
        <td>15.16
        <td>269,680
Isaac Gouy's avatar
Isaac Gouy committed
54
        <td>751
Isaac Gouy's avatar
Isaac Gouy committed
55 56
        <td>18.83
        <td class="message">72%&nbsp;50%&nbsp;89%&nbsp;65%
Isaac Gouy's avatar
Isaac Gouy committed
57 58
      <tbody>
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
59
        <th colspan="3"><a href="../performance/mandelbrot.html"><span>mandelbrot</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
60 61 62 63 64 65 66 67 68
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
69 70 71 72 73
        <td><a href="../program/mandelbrot-php-3.html"><span>PHP</span></a>
        <td class="best">118.28
        <td>139,504
        <td>875
        <td>472.05
Isaac Gouy's avatar
Isaac Gouy committed
74 75
        <td class="message">100%&nbsp;100%&nbsp;100%&nbsp;100%
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
76 77 78 79 80 81
        <td><a href="../program/mandelbrot-yarv-5.html"><span>Ruby</span></a>
        <td>482.17
        <td>96,460
        <td>1044
        <td>1,914.71
        <td class="message">100%&nbsp;100%&nbsp;100%&nbsp;100%
Isaac Gouy's avatar
Isaac Gouy committed
82 83
      <tbody>
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
84
        <th colspan="3"><a href="../performance/spectralnorm.html"><span>spectral-norm</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
85 86 87 88 89 90 91 92 93
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
94 95 96 97 98 99
        <td><a href="../program/spectralnorm-php-1.html"><span>PHP</span></a>
        <td class="best">38.56
        <td>20,848
        <td>1152
        <td>153.24
        <td class="message">99%&nbsp;100%&nbsp;99%&nbsp;99%
Isaac Gouy's avatar
Isaac Gouy committed
100
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
101 102 103 104 105 106
        <td><a href="../program/spectralnorm-yarv-5.html"><span>Ruby</span></a>
        <td>157.09
        <td>86,412
        <td>862
        <td>594.51
        <td class="message">96%&nbsp;94%&nbsp;95%&nbsp;94%
Isaac Gouy's avatar
Isaac Gouy committed
107 108
      <tbody>
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
109
        <th colspan="3"><a href="../performance/knucleotide.html"><span>k-nucleotide</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
110 111 112 113 114 115 116 117 118
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
119
        <td><a href="../program/knucleotide-php-4.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
120 121
        <td class="best">41.29
        <td>250,628
Isaac Gouy's avatar
Isaac Gouy committed
122
        <td>1079
Isaac Gouy's avatar
Isaac Gouy committed
123 124
        <td>134.20
        <td class="message">74%&nbsp;78%&nbsp;90%&nbsp;90%
Isaac Gouy's avatar
Isaac Gouy committed
125
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
126
        <td><a href="../program/knucleotide-yarv-7.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
127 128
        <td>108.90
        <td>387,100
Isaac Gouy's avatar
Isaac Gouy committed
129
        <td>880
Isaac Gouy's avatar
Isaac Gouy committed
130 131
        <td>378.11
        <td class="message">84%&nbsp;85%&nbsp;96%&nbsp;84%
Isaac Gouy's avatar
Isaac Gouy committed
132 133
      <tbody>
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
134
        <th colspan="3"><a href="../performance/fannkuchredux.html"><span>fannkuch-redux</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
135 136 137 138 139 140 141 142 143
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
144
        <td><a href="../program/fannkuchredux-php-3.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
145 146
        <td class="best">227.59
        <td>35,536
Isaac Gouy's avatar
Isaac Gouy committed
147
        <td>1160
Isaac Gouy's avatar
Isaac Gouy committed
148 149
        <td>906.63
        <td class="message">100%&nbsp;99%&nbsp;99%&nbsp;100%
Isaac Gouy's avatar
Isaac Gouy committed
150
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
151
        <td><a href="../program/fannkuchredux-yarv-2.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
152 153
        <td>583.02
        <td>58,756
Isaac Gouy's avatar
Isaac Gouy committed
154
        <td>1454
Isaac Gouy's avatar
Isaac Gouy committed
155 156
        <td>2,266.89
        <td class="message">100%&nbsp;100%&nbsp;99%&nbsp;90%
Isaac Gouy's avatar
Isaac Gouy committed
157
      <tbody>
Isaac Gouy's avatar
Isaac Gouy committed
158 159 160 161 162 163 164 165 166 167 168 169
      <tr>
        <th colspan="3"><a href="../performance/revcomp.html"><span>reverse-complement</span></a>
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
        <td><a href="../program/revcomp-php-3.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
170 171
        <td class="best">12.54
        <td>513,344
Isaac Gouy's avatar
Isaac Gouy committed
172
        <td>438
Isaac Gouy's avatar
Isaac Gouy committed
173 174
        <td>7.51
        <td class="message">59%&nbsp;6%&nbsp;61%&nbsp;28%
Isaac Gouy's avatar
Isaac Gouy committed
175 176 177 178 179 180 181 182
      <tr>
        <td><a href="../program/revcomp-yarv-5.html"><span>Ruby</span></a>
        <td>23.53
        <td>1,605,140
        <td>295
        <td>41.31
        <td class="message">51%&nbsp;54%&nbsp;31%&nbsp;61%
      <tbody>
Isaac Gouy's avatar
Isaac Gouy committed
183 184 185 186 187 188 189 190 191 192 193 194
      <tr>
        <th colspan="3"><a href="../performance/pidigits.html"><span>pidigits</span></a>
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
        <td><a href="../program/pidigits-php-5.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
195 196
        <td class="best">2.16
        <td>10,896
Isaac Gouy's avatar
Isaac Gouy committed
197
        <td>399
Isaac Gouy's avatar
Isaac Gouy committed
198 199
        <td>2.16
        <td class="message">0%&nbsp;1%&nbsp;100%&nbsp;0%
Isaac Gouy's avatar
Isaac Gouy committed
200 201
      <tr>
        <td><a href="../program/pidigits-yarv-5.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
202 203
        <td>3.39
        <td>274,164
Isaac Gouy's avatar
Isaac Gouy committed
204
        <td>485
Isaac Gouy's avatar
Isaac Gouy committed
205 206
        <td>6.82
        <td class="message">58%&nbsp;15%&nbsp;90%&nbsp;43%
Isaac Gouy's avatar
Isaac Gouy committed
207
      <tbody>
Isaac Gouy's avatar
Isaac Gouy committed
208
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
209
        <th colspan="3"><a href="../performance/nbody.html"><span>n-body</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
210 211 212 213 214 215 216 217 218
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
219
        <td><a href="../program/nbody-php-3.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
220 221
        <td class="best">333.78
        <td>9,400
Isaac Gouy's avatar
Isaac Gouy committed
222
        <td>1082
Isaac Gouy's avatar
Isaac Gouy committed
223 224
        <td>333.70
        <td class="message">44%&nbsp;30%&nbsp;1%&nbsp;27%
Isaac Gouy's avatar
Isaac Gouy committed
225
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
226
        <td><a href="../program/nbody-yarv-2.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
227 228
        <td>389.78
        <td>16,440
Isaac Gouy's avatar
Isaac Gouy committed
229
        <td>1137
Isaac Gouy's avatar
Isaac Gouy committed
230 231
        <td>434.87
        <td class="message">13%&nbsp;90%&nbsp;6%&nbsp;3%
Isaac Gouy's avatar
Isaac Gouy committed
232
      <tbody>
Isaac Gouy's avatar
Isaac Gouy committed
233 234 235 236 237 238 239 240 241 242 243 244
      <tr>
        <th colspan="3"><a href="../performance/fasta.html"><span>fasta</span></a>
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
        <td><a href="../program/fasta-php-3.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
245 246
        <td class="best">56.22
        <td>9,632
Isaac Gouy's avatar
Isaac Gouy committed
247
        <td>1062
Isaac Gouy's avatar
Isaac Gouy committed
248 249
        <td>56.20
        <td class="message">2%&nbsp;100%&nbsp;0%&nbsp;1%
Isaac Gouy's avatar
Isaac Gouy committed
250 251
      <tr>
        <td><a href="../program/fasta-yarv-6.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
252 253
        <td>63.70
        <td>98,956
Isaac Gouy's avatar
Isaac Gouy committed
254
        <td>1069
Isaac Gouy's avatar
Isaac Gouy committed
255 256
        <td>106.36
        <td class="message">69%&nbsp;54%&nbsp;15%&nbsp;30%
Isaac Gouy's avatar
Isaac Gouy committed
257
      <tbody>
Isaac Gouy's avatar
Isaac Gouy committed
258
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
259
        <th colspan="3"><a href="../performance/binarytrees.html"><span>binary-trees</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
260 261 262 263 264 265 266 267 268
        <th colspan="3">
      <tr>
        <th>source
        <th>secs
        <th>mem
        <th>gz
        <th>cpu
        <th>cpu load
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
269
        <td><a href="../program/binarytrees-php-6.html"><span>PHP</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
270 271
        <td>58.93
        <td>765,500
Isaac Gouy's avatar
Isaac Gouy committed
272
        <td>868
Isaac Gouy's avatar
Isaac Gouy committed
273 274
        <td>214.32
        <td class="message">90%&nbsp;98%&nbsp;92%&nbsp;90%
Isaac Gouy's avatar
Isaac Gouy committed
275
      <tr>
Isaac Gouy's avatar
Isaac Gouy committed
276
        <td><a href="../program/binarytrees-yarv-5.html"><span>Ruby</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
277 278
        <td>38.36
        <td>468,512
Isaac Gouy's avatar
Isaac Gouy committed
279
        <td>1107
Isaac Gouy's avatar
Isaac Gouy committed
280 281
        <td>115.36
        <td class="message">73%&nbsp;70%&nbsp;94%&nbsp;66%
Isaac Gouy's avatar
Isaac Gouy committed
282 283 284
      <tbody>
      <tr>
        <td>PHP
Isaac Gouy's avatar
Isaac Gouy committed
285 286 287
        <td colspan="5" class="message"><p>PHP 7.3.0 (cli) (built: Dec  6 2018 12:47:18) ( NTS )<br>
Copyright (c) 1997-2018 The PHP Group<br>
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies
Isaac Gouy's avatar
Isaac Gouy committed
288 289 290

      <tr>
        <td>Ruby
Isaac Gouy's avatar
Isaac Gouy committed
291
        <td colspan="5" class="message"><p>ruby 2.6.0preview3 (2018-11-06 trunk 65578) [x86_64-linux]
Isaac Gouy's avatar
Isaac Gouy committed
292 293 294 295

    </table>
    <nav>
      <ul>
Isaac Gouy's avatar
Isaac Gouy committed
296
        <p><a href="../measurements/php.html">all other PHP programs & measurements</a>
Isaac Gouy's avatar
Isaac Gouy committed
297 298 299 300 301 302 303
      </ul>
    </nav>
  </section>
</article>
<footer>
  <nav>
    <ul>
Isaac Gouy's avatar
Isaac Gouy committed
304 305 306
      <li><a href="../why-measure-toy-benchmark-programs.html"><span>Why toy programs?</span></a>
      <li><a href="../how-programs-are-measured.html"><span>How programs are measured</span></a>
      <li><a href="../dont-jump-to-conclusions.html"><span>The Ultimate Benchmark</span></a>
Isaac Gouy's avatar
Isaac Gouy committed
307 308 309
    </ul>
  </nav>
  <aside>
Isaac Gouy's avatar
Isaac Gouy committed
310
    <p>We want easy answers, but easy answers are often incomplete or wrong. You and I know, there's more we need to understand.
Isaac Gouy's avatar
Isaac Gouy committed
311 312 313 314
  </aside>
</footer>