Skip to content

Commit d2f7254

Browse files
version 1.0.1
1 parent 5a9262c commit d2f7254

File tree

1 file changed

+43
-2
lines changed

1 file changed

+43
-2
lines changed

Readme.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Documentation
2-
![](https://img.shields.io/badge/version-1.0.0-green.svg)
2+
![](https://img.shields.io/badge/version-1.0.1-green.svg)
33
![](https://img.shields.io/badge/Laravel->=5.6-blue.svg)
44
![](https://img.shields.io/badge/Lumen->=5.6-blue.svg)
55
![](https://img.shields.io/badge/Symfony->=4.2-blue.svg)
@@ -34,8 +34,49 @@
3434
$response = new Kosmosx\Response\RestResponse();
3535

3636
$handler = Kosmosx\Response\Exceptions\Handler();
37-
$handler->setExceptionHandler();
37+
$handler->setExceptionHandler();
38+
39+
### Benchmark
40+
41+
Same PC hardware (RAM: 16GB (2x8 GB) DDR4 2133 MHz, CPU: Intel Core i5 7400 Quad Core & 4 Thread 3.0GHz)
42+
43+
**Illuminate/Response**
44+
45+
Response weight 4.26Mb in 158~161ms
46+
47+
$app = array();
48+
for ($x = 0; $x <= 1000; $x++) {
49+
$app[$x] = new JsonResponse(array('data'=>[true,false], "message" => 'Microservice Lumen work', "state" => "OK"));
50+
}
51+
return var_dump($app);
3852

53+
**Kosmosx/Response**
54+
55+
Response weight 3.6Mb in 148~151ms
56+
57+
$app = array();
58+
for ($x = 0; $x <= 1000; $x++) {
59+
$app[$x] = new RestResponse(array('data'=>[true,false], "message" => 'Microservice Lumen work', "state" => "OK"));
60+
}
61+
return var_dump($app);
62+
63+
Response weight 3.6Mb in 220~223ms
64+
65+
$app = array();
66+
for ($x = 0; $x <= 1000; $x++) {
67+
$app[$x] = $this->response->success()
68+
->withMessage('Microservice Lumen work')
69+
->withData(true)
70+
->withData(false)
71+
->withState();
72+
}
73+
return var_dump($app);
74+
75+
Results
76+
77+
Kosmosx/Response it is 15.50% smaller than Illuminate
78+
Kosmosx/Response it is 6.3% faster than Illuminate (if use constructor)
79+
3980
**en**: [documentation](https://github.com/FabrizioCafolla/response-http/wiki/Response-http-documentation)
4081

4182
**it**: [documentazione](https://github.com/FabrizioCafolla/response-http/wiki/Documentazione-response-http)

0 commit comments

Comments
 (0)