Skip to content

Commit

Permalink
Merge pull request #12 from myaaghubi/v2.1.2
Browse files Browse the repository at this point in the history
V2.1.2
  • Loading branch information
myaaghubi authored Jul 21, 2023
2 parents 4a2c3f6 + 5dcb320 commit c75af99
Show file tree
Hide file tree
Showing 15 changed files with 162 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/output/
vendor/
#/*/code/
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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

Expand All @@ -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|
Expand All @@ -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
Expand Down Expand Up @@ -123,7 +124,6 @@ $ bash check.sh
3- Run benchmarks:

```bash
# bash check.sh -t pure-php
$ bash benchmark.sh
```

Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions benchmark.config
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ fastroute-1.3
fatfree-3.8.1
frameworkx-dev
fuelphp-1.9
kumbiaphp-1.1
laminas-2.0
laravel-10.0
leaf-3.3
Expand Down
5 changes: 5 additions & 0 deletions kumbiaphp-1.1/_benchmark/clean.sh
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
3 changes: 3 additions & 0 deletions kumbiaphp-1.1/_benchmark/clear-cache.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
# clear cache
echo -e "!"
2 changes: 2 additions & 0 deletions kumbiaphp-1.1/_benchmark/hello_world.sh
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"
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 kumbiaphp-1.1/_benchmark/kumbia/default/public/index.php
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';
13 changes: 13 additions & 0 deletions kumbiaphp-1.1/_benchmark/setup.sh
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
7 changes: 7 additions & 0 deletions kumbiaphp-1.1/_benchmark/update.sh
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
2 changes: 0 additions & 2 deletions output/.gitignore

This file was deleted.

Binary file modified 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 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 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 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.

0 comments on commit c75af99

Please sign in to comment.