-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
Conversation
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 )
(with 2240, the benchmarks in this post should still be accurate: #6358 (comment) - it was 2240 bytes when that benchmark was executed ) |
ext/hash/bench.php
Outdated
@@ -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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 :)
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 )