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
|
|
||
| $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.
It's been constant before, too?
There was a problem hiding this comment.
@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.
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 :)
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 )