Skip to content

Commit

Permalink
Update v1.3
Browse files Browse the repository at this point in the history
1. Some bug fixes.
2. Common errors solved.
3. clean.sh added.
4. update.sh & setup.sh & list.sh updated.
5. All frameworks updated.
6. Some enhancements & some minor changes.
  • Loading branch information
myaaghubi committed Apr 9, 2022
1 parent b782a1e commit 555abc2
Show file tree
Hide file tree
Showing 2,289 changed files with 654 additions and 284,205 deletions.
1 change: 0 additions & 1 deletion .gitignore

This file was deleted.

2 changes: 1 addition & 1 deletion benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cd benchmarks

sh hello_world.sh "$base"

php ../bin/show_results_table.php
php ../bin/show_results_table.php
24 changes: 11 additions & 13 deletions benchmarks/_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@ benchmark () {
output_wrk="output/$fw.wrk.log"
output="output/$fw.output"

# get rpm
# for this version of wrk -R (--rate) is necessary to use
# get rps
# for this version of wrk -R (--rate) is necessary to use for wsl
# I used a large number to make sure there be no limitation of rate
# for a high end server, you can increase first two parameters
echo "wrk -t50 -c50 -d10s -R1000g $url"
wrk -t50 -c50 -d10s -R1000g "$url" > "$output_wrk"

rps=""
i=4
# this loop is helpful to discover small numbers
while [ $i -lt 7 ] && [ -z "$rps" ]
do
rps=`grep "Requests/sec:" "$output_wrk" | cut -f $i -d " "`
i=$(( $i + 1 ))
done
# is it wsl!?
if grep -q Microsoft /proc/version; then
echo "wrk -t50 -c1000 -d10s -R1000g $url"
wrk -t50 -c1000 -d10s -R1000g "$url" > "$output_wrk"
else
echo "wrk -t50 -c1000 -d10s $url"
wrk -t50 -c1000 -d10s "$url" > "$output_wrk"
fi

rps=`grep "Requests/sec:" "$output_wrk" | tr -dc '0-9.'`

count=5

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/hello_world.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ mv "$url_file" "$url_file.old"
for fw in `echo $targets`
do
if [ -d "$fw" ]; then
echo "$fw"
echo "/------- $fw: benchmarking -------/"
echo "$fw/_benchmark/hello_world.sh"
. "$fw/_benchmark/hello_world.sh"
benchmark "$fw" "$url"
Expand Down
23 changes: 0 additions & 23 deletions cakephp-4.3/.editorconfig

This file was deleted.

34 changes: 0 additions & 34 deletions cakephp-4.3/.gitattributes

This file was deleted.

43 changes: 0 additions & 43 deletions cakephp-4.3/.gitignore

This file was deleted.

53 changes: 0 additions & 53 deletions cakephp-4.3/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* Development Mode:
* true: Errors and warnings shown.
*/
'debug' => filter_var(env('DEBUG', false), FILTER_VALIDATE_BOOLEAN),
/* *** php-frameworks-bench *** */
'debug' => false,

/*
* Security and encryption configuration
Expand All @@ -25,7 +26,7 @@
* You should treat it as extremely sensitive data.
*/
'Security' => [
'salt' => env('SECURITY_SALT', '__SALT__'),
'salt' => env('SECURITY_SALT', 'c68845eb71fab6866f7ee1177b2a0055c3ebc1995a4cb1116563e47fa64c9695'),
],

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,21 @@
*/
$routes->setRouteClass(DashedRoute::class);

/* *** php-frameworks-bench *** */
$routes->connect('/hello/index', ['controller' => 'HelloWorld', 'action' => 'display', 'home']);

$routes->scope('/', function (RouteBuilder $builder) {
/*
* Here, we are connecting '/' (base path) to a controller called 'Pages',
* its action called 'display', and we pass a param to select the view file
* to use (in this case, templates/Pages/home.php)...
*/
$builder->connect('/hello/index', ['controller' => 'helloworld', 'action' => 'display', 'home']);
$builder->connect('/', ['controller' => 'Pages', 'action' => 'display', 'home']);

/*
* ...and connect the rest of 'Pages' controller's URLs.
*/
$builder->connect('/pages/*', 'Pages::display');

/*
* Connect catchall routes for all controllers.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare(strict_types=1);

/*
php-frameworks-bench
this is a simple hello world controller to make benchmark
*/

namespace App\Controller;

use Cake\Http\Response;

// such simple controller
class HelloWorldController extends AppController {
public $autoRender = false;
public function display(string ...$path): ?Response {
return $this->response->withStringBody('Hello World!');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@
// Run the request/response through the application and emit the response.
$server->emit($server->run());

/* *** php-frameworks-bench *** */
require $_SERVER['DOCUMENT_ROOT'].'/php-frameworks-bench/libs/output_data.php';
3 changes: 3 additions & 0 deletions cakephp-4.3/_benchmark/clean.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
rm -rf !("_benchmark")
rm -rf _benchmark/temp
9 changes: 9 additions & 0 deletions cakephp-4.3/_benchmark/setup.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
#!/bin/sh
# create project
rm -rf _benchmark/temp
composer create-project --prefer-dist cakephp/app:4.3 ./_benchmark/temp
yes|mv ./_benchmark/temp/{.,}* ./

# have the route & controller
yes|cp -r _benchmark/cakephp/* ./

# some enhancement
composer dump-autoload -o
sudo rm -rf tmp/*
composer install --no-interaction --no-dev -o
10 changes: 10 additions & 0 deletions cakephp-4.3/_benchmark/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
composer update

# have the route & controller
yes|cp -r _benchmark/cakephp/* ./

# some enhancement
composer dump-autoload -o
sudo rm -rf tmp/*
composer install --no-interaction --no-dev -o
75 changes: 0 additions & 75 deletions cakephp-4.3/bin/cake

This file was deleted.

Loading

0 comments on commit 555abc2

Please sign in to comment.