Skip to content

Commit a729d41

Browse files
committed
Update benchmarks
1 parent bd10a66 commit a729d41

File tree

3 files changed

+32
-8
lines changed

3 files changed

+32
-8
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ docker-build:
2727

2828
.PHONY: benchmark
2929
benchmark: rebuild-changed
30-
docker run -v $(shell pwd):/compiler ircmaxell/php-compiler:16.04-dev php script/bench.php
30+
docker run -v $(shell pwd):/compiler --entrypoint php -e PHP_7_4=php ircmaxell/php-compiler:16.04 script/bench.php
3131

3232
.PHONY: build
33-
build: composer-install rebuild rebuild-examples
33+
build: composer-install rebuild fix rebuild-examples
3434

3535
.PHONY: rebuild
3636
rebuild:

benchmarks/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Each example includes a benchmark that compares each mode of operation to just r
1010

1111
| Test Name | 7.4 (s)| bin/jit.php (s) | bin/compile.php (s) | compiled time (s) |
1212
|--------------------|-------------------|-----------------|---------------------|-------------------|
13-
| Ack(3,10) | 1.7641 | 0.3593 | 0.1824 | 0.1612 |
14-
| Ack(3,8) | 0.1062 | 0.1607 | 0.1689 | 0.0108 |
15-
| Ack(3,9) | 0.3880 | 0.1984 | 0.1831 | 0.0392 |
16-
| fibo(30) | 0.0937 | 0.1652 | 0.1690 | 0.0083 |
17-
| mandelbrot | 0.1597 | 0.1770 | 0.1881 | 0.0135 |
18-
| simple | 0.0682 | 0.1670 | 0.1738 | 0.0114 |
13+
| Ack(3,10) | 1.9212 | 0.8305 | 0.6508 | 0.1548 |
14+
| Ack(3,8) | 0.1005 | 0.6248 | 0.6501 | 0.0115 |
15+
| Ack(3,9) | 0.3677 | 0.6654 | 0.6507 | 0.0383 |
16+
| fibo(30) | 0.0876 | 0.6213 | 0.6543 | 0.0085 |
17+
| fibo(32) | 0.2082 | 0.6383 | 0.6514 | 0.0197 |
18+
| mandelbrot | 0.1556 | 0.6465 | 0.6618 | 0.0148 |
19+
| simple | 0.0640 | 0.6362 | 0.6540 | 0.0117 |
1920

2021
<!-- benchmark table end -->

benchmarks/fibo(32).php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* This file is part of PHP-Compiler, a PHP CFG Compiler for PHP code
7+
*
8+
* @copyright 2015 Anthony Ferrara. All rights reserved
9+
* @license MIT See LICENSE at the root of the project for more info
10+
*/
11+
12+
function fibo_r(int $n): int
13+
{
14+
return ($n < 2) ? 1 : fibo_r($n - 2) + fibo_r($n - 1);
15+
}
16+
function fibo(int $n): void
17+
{
18+
$r = fibo_r($n);
19+
echo $r;
20+
echo "\n";
21+
}
22+
23+
fibo(32);

0 commit comments

Comments
 (0)