myaaghubi / PHP-Frameworks-Bench

A library to make benchmarks from PHP frameworks.
GNU General Public License v2.0
109 stars 4 forks source link

Slim 3.12 work but with deprecated errors in PHP8.2 #31

Closed joanhey closed 1 year ago

joanhey commented 1 year ago

image

myaaghubi commented 1 year ago

It got an update less than a week ago https://github.com/slimphp/Slim/releases/tag/3.12.5 so it is still maintained, let them update it dude

joanhey commented 1 year ago

https://github.com/slimphp/Slim/pull/3186#issuecomment-1098254226 This PR that fix for 8.1 was never merged, only closed !!

image

myaaghubi commented 1 year ago

It's a long time since I'm not using Slim, whatever the version, but that comment broke my heart

myaaghubi commented 1 year ago

I got no error Screenshot from 2023-07-29 15-56-24

Supporting php 8.2 is required, however it is still functional Slim 3.x first added by @stdex do you have any idea Rostunov

joanhey commented 1 year ago

No because you have configured your Apache to log the errors. You will have a very long error log file, with all the errors of each request.

And when write the error log, it's making that framework slower in the benchmark.

Theoretically, a benchmark need NOT to use logs in the hard disk only show it in STDOUT or STDERROR. Or when write to the hard disk, it's making slower the frameworks, without any visual feedback of the error.

myaaghubi commented 1 year ago

No because you have configured your Apache to log the errors. You will have a very long error log file, with all the errors of each request.

And when write the error log, it's making that framework slower in the benchmark.

Theoretically, a benchmark need NOT to use logs in the hard disk only show it in STDOUT or STDERROR. Or when write to the hard disk, it's making slower the frameworks, without any visual feedback of the error.

? I see no relation to the topic

joanhey commented 1 year ago

It's completely on topic to this issue.

What you do not understand ?

And I'll explain you.

myaaghubi commented 1 year ago

The topic is about slim 3.12 ... deprecated errors and you talking about errorlog/performance

joanhey commented 1 year ago

Yes, and you said me that you don't see the errors.

You don't see it, because your Apache is configured to not show it, but to log it to the hard disk. But Slim 3.12 have errors with PHP 8 and never it will be fixed.

In a benchmark we measure the performance, if Apache is writing the error log to the hardisk is making that framework slower. So our results are not favorable to any framework with errors.

If we show the errors, we know the frameworks with errors. And also they will be not penalized to write the errors to the hardisk.

myaaghubi commented 1 year ago

Ok, talking about performance led me wrong If you have any particular config for Apache plz mention it here For ErrorLog it's better to have it enabled then we can trace errors and fix them and finally we gonna have an empty error file with no lack in performance, more important for frameworks that contain errors, comparing RPS or any measurement is non-sense, but just disabling it not gonna show us errors. For CustomLog it's better to make it off, to prevent the performance issue and avoid getting storage full.

joanhey commented 1 year ago

Try the dockerfile and run check.sh in other terminal. It's only 2 files.

In one terminal apache.sh by default in port 8080, in the other terminal change the benchmark.config url to point to port 8080 and run check.sh.

https://github.com/myaaghubi/PHP-Frameworks-Bench/pull/32

PD: Apache use the default configuration of php:8.2-apache official docker.

joanhey commented 1 year ago

ErrorLog need to point to STDERR in a benchmark, and the access log to STDOUT.

joanhey commented 1 year ago

In production, we don't want that the server show any error. But in a benchmark or in dev, we want to instantly see the errors. And not hide it in the error log.

joanhey commented 1 year ago

It's the typical "In my computer works". We need to narrow to the minimum this syndrome. Need to work with almost any config.

myaaghubi commented 1 year ago

The setup process happens from 0 to 100 in both machines with the same php version/dependencies so it is not about that syndrome it is nothing to do with Apache too it is throwe via PHP.

ini_set('display_errors', '1');
ini_set('display_startup_errors', '1');
error_reporting(E_ALL);

The above lines are enough to catch errors

joanhey commented 1 year ago

Yes, but we don't need to write the logs. They only consume hardisk space, without any benefit and with performance lose. That is an apache config, and it's different in any user computer.

And the php.ini configuration, also it's different in any user computer, even different for php cli, mod_php, php-fpm,... So yes, we will have the problem of "In my computer works" but in yours not. With the docker, we don't have this problem.

myaaghubi commented 1 year ago

The result for slim 3 may not be valid because of deprecation errors so it is deleted 79b0ee0d4601e9e02ab29a4218c4aaaeb7150cb1