Skip to content

Commit c75af99

Browse files
authored
Merge pull request #12 from myaaghubi/v2.1.2
V2.1.2
2 parents 4a2c3f6 + 5dcb320 commit c75af99

File tree

15 files changed

+162
-7
lines changed

15 files changed

+162
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/output/
2+
vendor/
3+
#/*/code/

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Benchmarking on components like template engines or ORM/Database libraries is ou
1515
- [PHP Frameworks Bench](#php-frameworks-bench)
1616
- [Benchmarks](#benchmarks)
1717
- [Latest](#latest)
18-
- [OPCache](#opcache)
18+
- [OPCache On/Off](#opcache-on)
1919
- [Benchmarking Policy](#benchmarking-policy)
2020
- [How to Benchmark](#how-to-benchmark)
2121
- [Commands](#commands)
@@ -34,7 +34,7 @@ Benchmarking on components like template engines or ORM/Database libraries is ou
3434
* PHP 8.2.5
3535
* OPCache Off
3636
* Apache 2.4.52
37-
* WRK 4.2.0
37+
* WRK 4.2.0 (5 min)
3838
* CPU Core [email protected]
3939
* Memory 16G
4040

@@ -51,6 +51,7 @@ These are my benchmarks, not yours. **I encourage you to run on your (production
5151
|framework |requests per second (rps)|relative (rps)|peak memory|relative (mem)|
5252
|-------------------|------------------------:|-------------:|----------:|-------------:|
5353
|pure-php | 27,379.94| 282.4| 0.42| 1.0|
54+
|kumbiaphp-1.1 | 5,862.48| 60.5| 0.54| 1.3|
5455
|fastroute-1.3 | 4,591.01| 47.3| 0.56| 1.3|
5556
|phroute-2.2 | 4,303.07| 44.4| 0.58| 1.4|
5657
|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
7273
|laravel-10.0 | 96.97| 1.0| 11.99| 28.5|
7374

7475

75-
#### OPCache
76-
[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/Dk8YHQZ6jfY/0.jpg)](http://www.youtube.com/watch?v=Dk8YHQZ6jfY)
76+
#### OPCache On
77+
[![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)
7778

7879

7980
## Benchmarking Policy
@@ -123,7 +124,6 @@ $ bash check.sh
123124
3- Run benchmarks:
124125

125126
```bash
126-
# bash check.sh -t pure-php
127127
$ bash benchmark.sh
128128
```
129129

@@ -184,6 +184,7 @@ For frameworks, I considered the official repos:
184184
* [FatFree](https://github.com/bcosca/fatfree)
185185
* [FrameworkX](https://github.com/clue/framework-x)
186186
* [FuelPHP](https://github.com/fuelphp/fuelphp)
187+
* [KumbiaPHP](https://github.com/KumbiaPHP/KumbiaPHP)
187188
* [Laminas](https://github.com/laminas)
188189
* [Laravel](https://github.com/laravel/laravel)
189190
* [Leaf](https://github.com/leafsphp/leaf)

benchmark.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fastroute-1.3
2222
fatfree-3.8.1
2323
frameworkx-dev
2424
fuelphp-1.9
25+
kumbiaphp-1.1
2526
laminas-2.0
2627
laravel-10.0
2728
leaf-3.3

kumbiaphp-1.1/_benchmark/clean.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
rm -rf !("_benchmark")
3+
find -path './.*' -delete
4+
5+
rm -rf _benchmark/temp
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
# clear cache
3+
echo -e "!"
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
url="$base/$fw/default/public/index.php/helloworld/index"
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
class HelloworldController extends AppController
4+
{
5+
6+
public function index()
7+
{
8+
// View without template and view
9+
View::select(null, null);
10+
11+
echo 'Hello World!';
12+
}
13+
}
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?php
2+
/**
3+
* KumbiaPHP web & app Framework.
4+
*
5+
* LICENSE
6+
*
7+
* This source file is subject to the new BSD license that is bundled
8+
* with this package in the file LICENSE.
9+
*
10+
* @copyright Copyright (c) 2005 - 2020 KumbiaPHP Team (http://www.kumbiaphp.com)
11+
* @license https://github.com/KumbiaPHP/KumbiaPHP/blob/master/LICENSE New BSD License
12+
*/
13+
14+
/**
15+
* Esta sección prepara el entorno
16+
* Todo esto se puede hacer desde la configuración del
17+
* Servidor/PHP, en caso de no poder usarlo desde ahí
18+
* Puedes descomentar estas lineas.
19+
*/
20+
21+
//*Locale*
22+
//setlocale(LC_ALL, 'es_ES');
23+
24+
//*Timezone*
25+
//ini_set('date.timezone', 'America/New_York');
26+
27+
/**
28+
* @TODO
29+
* REVISAR ESTA SECCIÓN
30+
*/
31+
const APP_CHARSET = 'UTF-8';
32+
33+
/*
34+
* Indicar si la aplicacion se encuentra en producción
35+
* directamente desde el index.php
36+
*
37+
* ¡¡¡ ADVERTENCIA !!!
38+
* Cuando se efectua el cambio de production=false, a production=true, es necesario eliminar
39+
* el contenido del directorio de cache de la aplicación para que se renueve
40+
* la metadata (/app/tmp/cache/*)
41+
*/
42+
const PRODUCTION = false;
43+
44+
/*
45+
* Descomentar para mostrar los errores
46+
*/
47+
//error_reporting(E_ALL ^ E_STRICT);ini_set('display_errors', 'On');
48+
49+
/*
50+
* Define el APP_PATH
51+
*
52+
* APP_PATH:
53+
* - Ruta al directorio de la aplicación (por defecto la ruta al directorio app)
54+
* - Esta ruta se utiliza para cargar los archivos de la aplicacion
55+
* - En producción, es recomendable ponerla manual usando const
56+
*/
57+
define('APP_PATH', dirname(__DIR__).'/app/');
58+
//const APP_PATH = '/path/to/app/';
59+
60+
/*
61+
* Define el CORE_PATH
62+
*
63+
* CORE_PATH:
64+
* - Ruta al directorio que contiene el núcleo de Kumbia (por defecto la ruta al directorio core)
65+
* - En producción, es recomendable ponerla manual usando const
66+
*/
67+
define('CORE_PATH', dirname(dirname(APP_PATH)).'/core/');
68+
//const CORE_PATH = '/path/to/core/';
69+
70+
/*
71+
* Define el PUBLIC_PATH.
72+
*
73+
* PUBLIC_PATH:
74+
* - Path para genera la Url en los links a acciones y controladores
75+
* - Esta ruta la utiliza Kumbia como base para generar las Urls para acceder de lado de
76+
* cliente (con el navegador web) y es relativa al DOCUMENT_ROOT del servidor web
77+
*
78+
* EN PRODUCCION ESTA CONSTANTE DEBERÍA SER ESTABLECIDA MANUALMENTE
79+
*/
80+
define('PUBLIC_PATH', substr($_SERVER['SCRIPT_NAME'], 0, -9)); // - index.php string[9]
81+
82+
/**
83+
* En producción descomentar la línea de arriba y usar const
84+
* '/' en el root del dominio, recomendado
85+
* '/carpeta/' en una carpeta o varias
86+
* 'https://www.midominio.com/' usando dominio.
87+
*/
88+
//const PUBLIC_PATH = '/';
89+
90+
/**
91+
* Obtiene la url usando PATH_INFO.
92+
*/
93+
$url = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '/';
94+
95+
/**
96+
* Obtiene la url usando $_GET['_url']
97+
* Cambiar también en el .htaccess.
98+
*/
99+
//$url = isset($_GET['_url']) ? $_GET['_url'] : '/';
100+
101+
/**
102+
* Carga el gestor de arranque
103+
* Por defecto el bootstrap del core.
104+
*
105+
* @see Bootstrap
106+
*/
107+
//require APP_PATH . 'libs/bootstrap.php'; //bootstrap de app
108+
require CORE_PATH.'kumbia/bootstrap.php'; //bootstrap del core
109+
require $_SERVER['DOCUMENT_ROOT'].'/PHP-Frameworks-Bench/libs/output_data.php';

kumbiaphp-1.1/_benchmark/setup.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
# create project
3+
rm -rf _benchmark/temp
4+
composer create-project --prefer-dist kumbia/framework:^1.1 ./_benchmark/temp
5+
mv ./_benchmark/temp/{.,}* ./
6+
7+
# have the route & controller
8+
yes|cp -r _benchmark/kumbia/* ./
9+
10+
# some enhancements
11+
composer install --no-dev --optimize-autoloader
12+
13+
find . -name \*.htaccess -type f -delete

kumbiaphp-1.1/_benchmark/update.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
composer update --no-dev --optimize-autoloader
3+
4+
# have the route & controller
5+
yes|cp -r _benchmark/kumbia/* ./
6+
7+
find . -name \*.htaccess -type f -delete

0 commit comments

Comments
 (0)