Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show response length in check.sh #19

Merged
merged 5 commits into from
Jul 26, 2023
Merged

Conversation

joanhey
Copy link
Contributor

@joanhey joanhey commented Jul 26, 2023

In a benchmark all need to return the same response length.

For now it's only for information, so the dev can fix it.

PD: the length is calculated only for ASCII, that for this bench is correct

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

Now it's showing a very small difference, from 34 to 32 bytes. Still they need to return the same response, but it's very similar.

But sometimes can be a big diff, and it's best to fix it.

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

Seems that this small difference is from the output_data.php.

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

Now all have the same response size.

Before:
image

After:
image

So later, we can add a warning (not an error) if the length is more than 34 bytes.

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

Still we have the URL length difference, in the request.

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

2 bytes seems insignificant, but in a bench exist a big difference.

These 2 bytes in pure-php will be a drop of ~1.600 req/s.

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

Example of a very bad benchmark:

This image is in leaf framework repo
image

The people only see the Request per second, but nobody check the response size.
Also the transfer rate is x2 in Slim.

@myaaghubi
Copy link
Owner

no idea about slim but that is the reason to have PHP-Frameworks-Bench

@joanhey
Copy link
Contributor Author

joanhey commented Jul 26, 2023

The problem is that a lot of people use a Benchmarking as Bench Marketing.
And any trick is OK for them.

I'm tired to explain it:

A benchmark is not a competition, it's a really good tool to optimize the code.
Joanhey

But to be useful, we need to measure the data correctly.

@myaaghubi myaaghubi merged commit 32e6683 into myaaghubi:dev Jul 26, 2023
1 check passed
@joanhey joanhey deleted the resp-length branch July 26, 2023 16:20
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.

None yet

2 participants