Skip to content

Commit cd50851

Browse files
committed
Benchmark job does not need gmp
1 parent f4a2e33 commit cd50851

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/test-suite.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,6 @@ jobs:
10171017
sudo apt-get update
10181018
sudo apt-get install \
10191019
bison \
1020-
libgmp-dev \
10211020
libonig-dev \
10221021
libsqlite3-dev \
10231022
openssl \
@@ -1039,7 +1038,6 @@ jobs:
10391038
--enable-werror \
10401039
--prefix=/usr \
10411040
--with-config-file-scan-dir=/etc/php.d \
1042-
--with-gmp \
10431041
--with-mysqli=mysqlnd \
10441042
--with-openssl \
10451043
--with-pdo-sqlite \

benchmark/benchmark.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require_once __DIR__ . '/shared.php';
44

5-
foreach (array("mbstring", "sockets", "mysqli", "openssl", "gmp") as $ext) {
5+
foreach (array("mbstring", "sockets", "mysqli", "openssl") as $ext) {
66
if (!extension_loaded($ext)) {
77
throw new LogicException("Extension $ext is required.");
88
}
@@ -131,14 +131,17 @@ function runValgrindPhpCgiCommand(
131131
]);
132132
$instructions = extractInstructionsFromValgrindOutput($process->stderr);
133133
if ($repeat > 1) {
134-
$instructions = gmp_strval(gmp_div_q($instructions, $repeat));
134+
$instructions = intdiv($instructions, $repeat);
135135
}
136136
return ['instructions' => $instructions];
137137
}
138138

139-
function extractInstructionsFromValgrindOutput(string $output): string {
140-
preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches);
141-
return $matches['instructions'] ?? throw new \Exception('Unexpected valgrind output');
139+
function extractInstructionsFromValgrindOutput(string $output): int {
140+
if (!preg_match("(==[0-9]+== Events : Ir\n==[0-9]+== Collected : (?<instructions>[0-9]+))", $output, $matches)) {
141+
throw new \Exception('Unexpected valgrind output');
142+
}
143+
144+
return (int) $matches['instructions'];
142145
}
143146

144147
main();

0 commit comments

Comments
 (0)