Skip to content

Commit 6c71d34

Browse files
divinity76nikic
authored andcommitted
Use constant size string in hash bench.php
I don't like the previous behaviour where the bytes to hash change every time the code changes, that may make it difficult to compare hash() performance changes over time. Use a fixed number instead, and allow passing an override for a different length. Closes GH-6386. [ci skip]
1 parent dd008fd commit 6c71d34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/hash/bench.php

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

44
error_reporting(E_ALL);
55

6-
$data = file_get_contents(__FILE__);
6+
$data = str_repeat("\x00", (int) ($argv[1] ?? (2 * 1024)));
77
$time = array();
88
foreach (hash_algos() as $algo) {
99
$time[$algo] = 0;

0 commit comments

Comments
 (0)