Skip to content

Commit 0fe04c5

Browse files
authored
constant size for bench.php
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 )
1 parent c80cb79 commit 0fe04c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ext/hash/bench.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
error_reporting(E_ALL);
55

6-
$data = file_get_contents(__FILE__);
6+
// 2240 comes from the fact that it used to be file_get_contents(__FILE__);
7+
$data = str_repeat("\x00", 2240);
78
$time = array();
89
foreach (hash_algos() as $algo) {
910
$time[$algo] = 0;

0 commit comments

Comments
 (0)