Skip to content

constant size for bench.php #6386

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

Closed
wants to merge 2 commits into from
Closed

Conversation

divinity76
Copy link
Contributor

i don't like the previous behaviour where the bytes to hash change every time the code change,
that may make it difficult to compare hash() performance changes over time,

as a recent example, Nikita's commit from 2020-10-26 changed the bytes to hash from 2240 bytes to 503 bytes.. ( e0ea3e8 )

i don't like the previous behaviour where the bytes to hash change every time the code change, 
that may make it difficult to compare hash() performance changes over time,

as a recent example, Nikita's commit from 2020-10-26 changed the bytes to hash from 2240 bytes to 503 bytes.. ( e0ea3e8 )
@divinity76
Copy link
Contributor Author

divinity76 commented Oct 27, 2020

(with 2240, the benchmarks in this post should still be accurate: #6358 (comment) - it was 2240 bytes when that benchmark was executed )

@@ -3,7 +3,8 @@

error_reporting(E_ALL);

$data = file_get_contents(__FILE__);
// 2240 comes from the fact that it used to be file_get_contents(__FILE__);
$data = str_repeat("\x00", 2240);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's been constant before, too?

Copy link
Contributor Author

@divinity76 divinity76 Oct 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m6w6 not exactly.
in revision 7a08865 it was 1949 bytes.
in revision 8d3f8ca it was 1938 bytes.
in revision 02294f0 it was 1957 bytes.
in revision 58b1790 it was 2178 bytes
in revision 3d1e7d3 it was 2240 bytes
, and in the current revision it's 503 bytes.. ( e0ea3e8 )
a 77% reduction in bytes to hash in the last revision,

with such fluctation in the number of bytes to hash, benchmarks like this may no longer reproduce: #6358 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's any point in preserving the exact previous size. Let's make this a nice round number like 2048. Could also make it $argv[1] ?? 2048 to allow passing a different size :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikic sounds good to me, how about e213df9

quote: 
@nikic
I don't think there's any point in preserving the exact previous size. Let's make this a nice round number like 2048. Could also make it $argv[1] ?? 2048 to allow passing a different size :)
@php-pulls php-pulls closed this in 6c71d34 Oct 30, 2020
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.

3 participants