-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from myaaghubi/v2.1.2
V2.1.2
- Loading branch information
Showing
15 changed files
with
162 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/output/ | ||
vendor/ | ||
#/*/code/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ Benchmarking on components like template engines or ORM/Database libraries is ou | |
- [PHP Frameworks Bench](#php-frameworks-bench) | ||
- [Benchmarks](#benchmarks) | ||
- [Latest](#latest) | ||
- [OPCache](#opcache) | ||
- [OPCache On/Off](#opcache-on) | ||
- [Benchmarking Policy](#benchmarking-policy) | ||
- [How to Benchmark](#how-to-benchmark) | ||
- [Commands](#commands) | ||
|
@@ -34,7 +34,7 @@ Benchmarking on components like template engines or ORM/Database libraries is ou | |
* PHP 8.2.5 | ||
* OPCache Off | ||
* Apache 2.4.52 | ||
* WRK 4.2.0 | ||
* WRK 4.2.0 (5 min) | ||
* CPU Core [email protected] | ||
* Memory 16G | ||
|
||
|
@@ -51,6 +51,7 @@ These are my benchmarks, not yours. **I encourage you to run on your (production | |
|framework |requests per second (rps)|relative (rps)|peak memory|relative (mem)| | ||
|-------------------|------------------------:|-------------:|----------:|-------------:| | ||
|pure-php | 27,379.94| 282.4| 0.42| 1.0| | ||
|kumbiaphp-1.1 | 5,862.48| 60.5| 0.54| 1.3| | ||
|fastroute-1.3 | 4,591.01| 47.3| 0.56| 1.3| | ||
|phroute-2.2 | 4,303.07| 44.4| 0.58| 1.4| | ||
|leaf-3.3 | 1,576.68| 16.3| 1.10| 2.6| | ||
|
@@ -72,8 +73,8 @@ These are my benchmarks, not yours. **I encourage you to run on your (production | |
|laravel-10.0 | 96.97| 1.0| 11.99| 28.5| | ||
|
||
|
||
#### OPCache | ||
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/Dk8YHQZ6jfY/0.jpg)](http://www.youtube.com/watch?v=Dk8YHQZ6jfY) | ||
#### OPCache On | ||
[![Results with OPCache On/Off & How to add your framework](http://img.youtube.com/vi/Dk8YHQZ6jfY/0.jpg)](http://www.youtube.com/watch?v=Dk8YHQZ6jfY) | ||
|
||
|
||
## Benchmarking Policy | ||
|
@@ -123,7 +124,6 @@ $ bash check.sh | |
3- Run benchmarks: | ||
|
||
```bash | ||
# bash check.sh -t pure-php | ||
$ bash benchmark.sh | ||
``` | ||
|
||
|
@@ -184,6 +184,7 @@ For frameworks, I considered the official repos: | |
* [FatFree](https://github.com/bcosca/fatfree) | ||
* [FrameworkX](https://github.com/clue/framework-x) | ||
* [FuelPHP](https://github.com/fuelphp/fuelphp) | ||
* [KumbiaPHP](https://github.com/KumbiaPHP/KumbiaPHP) | ||
* [Laminas](https://github.com/laminas) | ||
* [Laravel](https://github.com/laravel/laravel) | ||
* [Leaf](https://github.com/leafsphp/leaf) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
rm -rf !("_benchmark") | ||
find -path './.*' -delete | ||
|
||
rm -rf _benchmark/temp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
# clear cache | ||
echo -e "!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/sh | ||
url="$base/$fw/default/public/index.php/helloworld/index" |
13 changes: 13 additions & 0 deletions
13
kumbiaphp-1.1/_benchmark/kumbia/default/app/controllers/helloworld_controller.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
class HelloworldController extends AppController | ||
{ | ||
|
||
public function index() | ||
{ | ||
// View without template and view | ||
View::select(null, null); | ||
|
||
echo 'Hello World!'; | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
kumbiaphp-1.1/_benchmark/kumbia/default/public/index.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?php | ||
/** | ||
* KumbiaPHP web & app Framework. | ||
* | ||
* LICENSE | ||
* | ||
* This source file is subject to the new BSD license that is bundled | ||
* with this package in the file LICENSE. | ||
* | ||
* @copyright Copyright (c) 2005 - 2020 KumbiaPHP Team (http://www.kumbiaphp.com) | ||
* @license https://github.com/KumbiaPHP/KumbiaPHP/blob/master/LICENSE New BSD License | ||
*/ | ||
|
||
/** | ||
* Esta sección prepara el entorno | ||
* Todo esto se puede hacer desde la configuración del | ||
* Servidor/PHP, en caso de no poder usarlo desde ahí | ||
* Puedes descomentar estas lineas. | ||
*/ | ||
|
||
//*Locale* | ||
//setlocale(LC_ALL, 'es_ES'); | ||
|
||
//*Timezone* | ||
//ini_set('date.timezone', 'America/New_York'); | ||
|
||
/** | ||
* @TODO | ||
* REVISAR ESTA SECCIÓN | ||
*/ | ||
const APP_CHARSET = 'UTF-8'; | ||
|
||
/* | ||
* Indicar si la aplicacion se encuentra en producción | ||
* directamente desde el index.php | ||
* | ||
* ¡¡¡ ADVERTENCIA !!! | ||
* Cuando se efectua el cambio de production=false, a production=true, es necesario eliminar | ||
* el contenido del directorio de cache de la aplicación para que se renueve | ||
* la metadata (/app/tmp/cache/*) | ||
*/ | ||
const PRODUCTION = false; | ||
|
||
/* | ||
* Descomentar para mostrar los errores | ||
*/ | ||
//error_reporting(E_ALL ^ E_STRICT);ini_set('display_errors', 'On'); | ||
|
||
/* | ||
* Define el APP_PATH | ||
* | ||
* APP_PATH: | ||
* - Ruta al directorio de la aplicación (por defecto la ruta al directorio app) | ||
* - Esta ruta se utiliza para cargar los archivos de la aplicacion | ||
* - En producción, es recomendable ponerla manual usando const | ||
*/ | ||
define('APP_PATH', dirname(__DIR__).'/app/'); | ||
//const APP_PATH = '/path/to/app/'; | ||
|
||
/* | ||
* Define el CORE_PATH | ||
* | ||
* CORE_PATH: | ||
* - Ruta al directorio que contiene el núcleo de Kumbia (por defecto la ruta al directorio core) | ||
* - En producción, es recomendable ponerla manual usando const | ||
*/ | ||
define('CORE_PATH', dirname(dirname(APP_PATH)).'/core/'); | ||
//const CORE_PATH = '/path/to/core/'; | ||
|
||
/* | ||
* Define el PUBLIC_PATH. | ||
* | ||
* PUBLIC_PATH: | ||
* - Path para genera la Url en los links a acciones y controladores | ||
* - Esta ruta la utiliza Kumbia como base para generar las Urls para acceder de lado de | ||
* cliente (con el navegador web) y es relativa al DOCUMENT_ROOT del servidor web | ||
* | ||
* EN PRODUCCION ESTA CONSTANTE DEBERÍA SER ESTABLECIDA MANUALMENTE | ||
*/ | ||
define('PUBLIC_PATH', substr($_SERVER['SCRIPT_NAME'], 0, -9)); // - index.php string[9] | ||
|
||
/** | ||
* En producción descomentar la línea de arriba y usar const | ||
* '/' en el root del dominio, recomendado | ||
* '/carpeta/' en una carpeta o varias | ||
* 'https://www.midominio.com/' usando dominio. | ||
*/ | ||
//const PUBLIC_PATH = '/'; | ||
|
||
/** | ||
* Obtiene la url usando PATH_INFO. | ||
*/ | ||
$url = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/'; | ||
|
||
/** | ||
* Obtiene la url usando $_GET['_url'] | ||
* Cambiar también en el .htaccess. | ||
*/ | ||
//$url = isset($_GET['_url']) ? $_GET['_url'] : '/'; | ||
|
||
/** | ||
* Carga el gestor de arranque | ||
* Por defecto el bootstrap del core. | ||
* | ||
* @see Bootstrap | ||
*/ | ||
//require APP_PATH . 'libs/bootstrap.php'; //bootstrap de app | ||
require CORE_PATH.'kumbia/bootstrap.php'; //bootstrap del core | ||
require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/sh | ||
# create project | ||
rm -rf _benchmark/temp | ||
composer create-project --prefer-dist kumbia/framework:^1.1 ./_benchmark/temp | ||
mv ./_benchmark/temp/{.,}* ./ | ||
|
||
# have the route & controller | ||
yes|cp -r _benchmark/kumbia/* ./ | ||
|
||
# some enhancements | ||
composer install --no-dev --optimize-autoloader | ||
|
||
find . -name \*.htaccess -type f -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
composer update --no-dev --optimize-autoloader | ||
|
||
# have the route & controller | ||
yes|cp -r _benchmark/kumbia/* ./ | ||
|
||
find . -name \*.htaccess -type f -delete |
This file was deleted.
Oops, something went wrong.
Binary file modified
BIN
+32.2 KB
(300%)
screenshots/php-frameworks-bench-exectime.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+34.3 KB
(310%)
screenshots/php-frameworks-bench-includedfiles.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+32.5 KB
(320%)
screenshots/php-frameworks-bench-memory.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
+43 KB
(350%)
screenshots/php-frameworks-bench-throughput.png
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.