File tree Expand file tree Collapse file tree 3 files changed +32
-8
lines changed Expand file tree Collapse file tree 3 files changed +32
-8
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ docker-build:
27
27
28
28
.PHONY : benchmark
29
29
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
31
31
32
32
.PHONY : build
33
- build : composer-install rebuild rebuild-examples
33
+ build : composer-install rebuild fix rebuild-examples
34
34
35
35
.PHONY : rebuild
36
36
rebuild :
Original file line number Diff line number Diff line change @@ -10,11 +10,12 @@ Each example includes a benchmark that compares each mode of operation to just r
10
10
11
11
| Test Name | 7.4 (s)| bin/jit.php (s) | bin/compile.php (s) | compiled time (s) |
12
12
| --------------------| -------------------| -----------------| ---------------------| -------------------|
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 |
19
20
20
21
<!-- benchmark table end -->
Original file line number Diff line number Diff line change
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 );
You can’t perform that action at this time.
0 commit comments