Skip to content

Commit a4804cb

Browse files
committed
Run benchmarks without Apache
1 parent 2ca1f15 commit a4804cb

File tree

8 files changed

+35
-6586
lines changed

8 files changed

+35
-6586
lines changed

benchmark-no-apache.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
#base="http://127.0.0.1/php-framework-benchmark"
4+
base="http://localhost:8888/php-framework-benchmark"
5+
6+
cd `dirname $0`
7+
8+
php -S localhost:8888 -t .. > /dev/null 2>&1 &
9+
PHP_PID=$!
10+
sleep 2;
11+
12+
if [ $# -eq 0 ]; then
13+
# include framework list
14+
. ./list.sh
15+
export targets="$list"
16+
else
17+
export targets="${@%/}"
18+
fi
19+
20+
cd benchmarks
21+
22+
sh hello_world.sh "$base"
23+
24+
php ../bin/show_results_table.php
25+
kill $PHP_PID

benchmarks/_functions.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ benchmark ()
1313
# get time
1414
count=10
1515
total=0
16-
for ((i=0; i < $count; i++)); do
16+
#for ((i=0; i < $count; i++)); do
17+
for i in $(seq 0 $count); do
1718
curl "$url" > "$output"
1819
t=`tail -1 "$output" | cut -f 2 -d ':'`
1920
total=`php ./benchmarks/sum_ms.php $t $total`

libs/parse_results.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function parse_results($file)
1818
$time = (float) trim($column[3])*1000;
1919
$file = (int) trim($column[4]);
2020

21-
$min_rps = min($min_rps, $rps);
22-
$min_memory = min($min_memory, $memory);
23-
$min_time = min($min_time, $time);
24-
$min_file = min($min_file, $file);
21+
$min_rps = min($min_rps, $rps ?: INF);
22+
$min_memory = min($min_memory, $memory ?: INF);
23+
$min_time = min($min_time, $time ?: INF);
24+
$min_file = min($min_file, $file ?: INF);
2525

2626
$results[$fw] = [
2727
'rps' => $rps,

nofuss-1.2/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/cache/
2+
!/cache/.gitkeep
3+
!/cache/smarty/.gitignore
4+
!/cache/templates_c/.gitignore

nofuss-1.2/cache/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)