Skip to content

Comments

Nette 3.3#81

Merged
myaaghubi merged 8 commits intomyaaghubi:devfrom
raneomik:nette-3.3
Jan 6, 2026
Merged

Nette 3.3#81
myaaghubi merged 8 commits intomyaaghubi:devfrom
raneomik:nette-3.3

Conversation

@raneomik
Copy link

@raneomik raneomik commented Dec 2, 2025

Nette framework addition suggestion

This was referenced Dec 2, 2025
@macropay-solutions
Copy link

macropay-solutions commented Dec 4, 2025

Hi. Do you have some benchmarks from your local in comparison with Lumen? We tested this benchmark project and it seems it is influenced by the order of the bench-marked frameworks from the config. So best would be to run one framework at a time and record first test because subsequent tests are faster.

@raneomik
Copy link
Author

raneomik commented Dec 5, 2025

Hi. Do you have some benchmarks from your local in comparison with Lumen? We tested this benchmark project and it seems it is influenced by the order of the bench-marked frameworks from the config. So best would be to run one framework at a time and record first test because subsequent tests are faster.

Hello, okay, here are independent results of lumen-10.0 and nette3.3 (used bash benchmark.sh -t lumen-10.0 and bash benchmark.sh -t nette3.3 - on widows' wsl running bash docker-apache.sh) :

/------- lumen-10.0: benchmarking -------/
wrk -t50 -c500 -d60s http://localhost:888/PHP-Frameworks-Bench/lumen-10.0/public/index.php/hello/index
rps: 2107.89

 Results:               25-12-05T19-21-16
 Compare to:            25-12-05T19-18-50
|-------------------|------------------------:|-------------:|----------:|-------------:|
|framework          |requests per second (rps)|relative (rps)|peak memory|relative (mem)|
|-------------------|------------------------:|-------------:|----------:|-------------:|
|lumen-10.0         |             2,107.89 (-)|           1.0|   0.38 (-)|           1.0|


/------- nette-3.3: benchmarking -------/
wrk -t50 -c500 -d60s http://localhost:888/PHP-Frameworks-Bench/nette-3.3/www/index.php/hello/index
rps: 2694.55

 Results:               25-12-05T19-18-50
 Compare to:            25-12-05T19-18-42
|-------------------|------------------------:|-------------:|----------:|-------------:|
|framework          |requests per second (rps)|relative (rps)|peak memory|relative (mem)|
|-------------------|------------------------:|-------------:|----------:|-------------:|
|nette-3.3          |             2,694.55 (-)|           1.0|   0.87 (-)|           1.0|
```

@marius-ciclistu
Copy link

marius-ciclistu commented Dec 5, 2025

Nice 28.5% faster.

@myaaghubi myaaghubi changed the base branch from main to dev December 9, 2025 12:42
@joanhey
Copy link
Contributor

joanhey commented Dec 10, 2025

This PR fail with Nette:
https://github.com/myaaghubi/PHP-Frameworks-Bench/actions/runs/19876586169/job/57574145574?pr=81#step:9:26

PD: seems that the response only send 33 bytes, not the 34 bytes to pass the tests

@joanhey
Copy link
Contributor

joanhey commented Dec 10, 2025

Normally when fail show:

Hello World!
 2013600:0.021917:008

But Nette show:
Hello World! 8491968:0.059148:236

The https://github.com/myaaghubi/PHP-Frameworks-Bench/blob/main/libs/output_data.php#L4
create a new line always.

@raneomik raneomik force-pushed the nette-3.3 branch 2 times, most recently from f8ca69f to e6a7522 Compare December 16, 2025 20:23
@myaaghubi
Copy link
Owner

@raneomik make sure to check the output format for the Hello World, it should be a raw output, and sync your pr with the latest updates of the dev bench.

@raneomik
Copy link
Author

raneomik commented Dec 29, 2025

@raneomik make sure to check the output format for the Hello World, it should be a raw output, and sync your pr with the latest updates of the dev bench.

hi, sorry for being so inactive here, it sort of slipped out of my mind with job and holidays...

I don't understand why in CI it doesn't have this new line mentioned by @joanhey, locally I don't see any issue... :

image

I launch it with docker-apache.sh, there are no notable differences between its configuration and the one in github actions ?

update : just tested with plain apache, and I indeed had the debug bar included :

❌ nette-3.3 
http://127.0.0.1/PHP-Frameworks-Bench/nette-3.3/www/index.php/hello/index
Hello World!
 1024608:0.002420:104



<!-- Tracy Debug Bar -->
<script src="/PHP-Frameworks-Bench/nette-3.3/www/index.php/hello/index?_tracy_bar=js&amp;v=2.11.0&amp;XDEBUG_SESSION_STOP=1" data-id="00bdf09bd5"></script>
...

but with the new line, and once disabled, it passes well ...:

....
✔ lumen-10.0            34 bytes   http://127.0.0.1/PHP-Frameworks-Bench/lumen-10.0/public/index.php/hello/index
✔ nette-3.3             34 bytes   http://127.0.0.1/PHP-Frameworks-Bench/nette-3.3/www/index.php/hello/index
✔ phroute-2.2           34 bytes   http://127.0.0.1/PHP-Frameworks-Bench/phroute-2.2/public/index.php/hello/index
...

according to the CI result, it seems ok now

@myaaghubi
Copy link
Owner

Plz use a controller to print/return Hello World

@joanhey
Copy link
Contributor

joanhey commented Dec 30, 2025

@myaaghubi I think that more frameworks return the "Hello world!" not in the controller.
Normally the micro frameworks make that, and are faster in an small bench like this one.
But in a bench with more routes and db, they fail completely. Or in a normal app.

I think that is correct that you ask that the string "Hello world!" come from the controller, not the router.

Happy new year !!!!

@raneomik
Copy link
Author

raneomik commented Jan 1, 2026

I think that is correct that you ask that the string "Hello world!" come from the controller, not the router.

Hello, I think so too, so it's been adapted using nette's "presenter", their equivalent for controllers. It just needed the output_data.php script to be placed in the presenter as the expected output isn't rendering from index.php...

Happy new year !

@raneomik raneomik requested a review from joanhey January 1, 2026 17:32
@joanhey
Copy link
Contributor

joanhey commented Jan 2, 2026

Good job @raneomik
The output_data.php in the controller is a problem with others frameworks, but the execution time is not reliable to compare, for that I create a new issue #90.

@myaaghubi
Copy link
Owner

I spent hours fixing it. It would/should be fixed by tweaking the presenter.
For the other attached files, it would be fine if that is the minimum needed.

@raneomik
Copy link
Author

raneomik commented Jan 5, 2026

I spent hours fixing it. It would/should be fixed by tweaking the presenter.

Nice work 👏 good to know that adding the default template fixes it to what it supposed to do.

For the other attached files, it would be fine if that is the minimum needed.

I removed the config files so there will be those generated on the framework install - is it ok or should I add some minimalistic config ?

Also moved sudo to delete all in the root, as in _benchmark dir it's not supposed to have anything generated by the server.
Or is there another reason to have sudo there ?

@myaaghubi myaaghubi merged commit c33676f into myaaghubi:dev Jan 6, 2026
1 check passed
Repository owner deleted a comment from joanhey Jan 6, 2026
Repository owner deleted a comment from raneomik Jan 6, 2026
@raneomik raneomik deleted the nette-3.3 branch January 6, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants