File tree Expand file tree Collapse file tree 7 files changed +66
-19
lines changed Expand file tree Collapse file tree 7 files changed +66
-19
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ RUN git clone https://github.com/nikic/php-ast . && \
23
23
make && \
24
24
make install
25
25
26
+ WORKDIR ../sample_prof
27
+ RUN git clone https://github.com/nikic/sample_prof.git . && \
28
+ phpize && \
29
+ ./configure && \
30
+ make && \
31
+ make install
32
+
26
33
COPY php.ini /usr/local/lib/php.ini
27
34
28
35
RUN curl --silent --show-error https://getcomposer.org/installer | php -- --no-ansi --install-dir=/usr/local/bin --filename=composer
Original file line number Diff line number Diff line change 1
1
memory_limit =-1
2
2
extension =ast.so
3
+ extension =sample_prof.so
Original file line number Diff line number Diff line change @@ -10,12 +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.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 |
13
+ | Ack(3,10) | 1.9183 | 0.4112 | 0.2330 | 0.1654 |
14
+ | Ack(3,8) | 0.1006 | 0.2105 | 0.2337 | 0.0115 |
15
+ | Ack(3,9) | 0.3685 | 0.2519 | 0.2339 | 0.0403 |
16
+ | fibo(30) | 0.0880 | 0.2071 | 0.2325 | 0.0083 |
17
+ | fibo(32) | 0.2091 | 0.2221 | 0.2334 | 0.0192 |
18
+ | mandelbrot | 0.1574 | 0.2302 | 0.2451 | 0.0135 |
19
+ | simple | 0.0641 | 0.2156 | 0.2363 | 0.0114 |
20
20
21
21
<!-- benchmark table end -->
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ sample_prof_start (50 ); // start profiler with 50 usec interval
4
+ require __DIR__ . '/../compile.php ' ; // run script here
5
+ sample_prof_end (); // disable profiler
6
+ $ data = sample_prof_get_data (); // retrieve profiling data
7
+
8
+ foreach ($ data as $ file => $ lines ) {
9
+ echo "In file $ file: \n" ;
10
+ foreach ($ lines as $ line => $ hits ) {
11
+ echo "Line $ line hit $ hits times. \n" ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ sample_prof_start (10 ); // start profiler with 50 usec interval
4
+ require __DIR__ . '/../jit.php ' ; // run script here
5
+ sample_prof_end (); // disable profiler
6
+ $ data = sample_prof_get_data (); // retrieve profiling data
7
+
8
+ foreach ($ data as $ file => $ lines ) {
9
+ echo "In file $ file: \n" ;
10
+ foreach ($ lines as $ line => $ hits ) {
11
+ echo "Line $ line hit $ hits times. \n" ;
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ sample_prof_start (50 ); // start profiler with 50 usec interval
4
+ require __DIR__ . '/../vm.php ' ; // run script here
5
+ sample_prof_end (); // disable profiler
6
+ $ data = sample_prof_get_data (); // retrieve profiling data
7
+
8
+ foreach ($ data as $ file => $ lines ) {
9
+ echo "In file $ file: \n" ;
10
+ foreach ($ lines as $ line => $ hits ) {
11
+ echo "Line $ line hit $ hits times. \n" ;
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments