Skip to content

Commit 1c9c3af

Browse files
committed
Add Laravel demo page to benchmark CI
The demo page doesn't do a lot, but might still be useful. 100 runs is enough to get rid of any prominent compilation overhead in the profiles. Closes GH-12466.
1 parent 25f42bc commit 1c9c3af

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

benchmark/benchmark.php

+13
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ function main() {
2727
$data['Symfony Demo 2.2.3 JIT'] = runSymfonyDemo(true);
2828
$data['Wordpress 6.2'] = runWordpress(false);
2929
$data['Wordpress 6.2 JIT'] = runWordpress(true);
30+
$data['Laravel 10.10'] = runLaravelDemo(false);
31+
$data['Laravel 10.10 JIT'] = runLaravelDemo(true);
3032
$result = json_encode($data, JSON_PRETTY_PRINT) . "\n";
3133

3234
fwrite(STDOUT, $result);
@@ -89,6 +91,17 @@ function runWordpress(bool $jit): array {
8991
return runValgrindPhpCgiCommand('wordpress', [$dir . '/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 50);
9092
}
9193

94+
function runLaravelDemo(bool $jit): array {
95+
96+
$dir = __DIR__ . '/repos/laravel-demo-10.10';
97+
cloneRepo($dir, 'https://github.com/php/benchmarking-laravel-demo-10.10.git');
98+
runPhpCommand([$dir . '/artisan', 'config:cache']);
99+
runPhpCommand([$dir . '/artisan', 'event:cache']);
100+
runPhpCommand([$dir . '/artisan', 'route:cache']);
101+
runPhpCommand([$dir . '/artisan', 'view:cache']);
102+
return runValgrindPhpCgiCommand('laravel-demo', [$dir . '/public/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 100);
103+
}
104+
92105
function runPhpCommand(array $args, ?string $cwd = null): ProcessResult {
93106
return runCommand([PHP_BINARY, ...$args], $cwd);
94107
}

0 commit comments

Comments
 (0)