Skip to content

Add Laravel demo page benchmark to CI #12466

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions benchmark/benchmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ function main() {
$data['Symfony Demo 2.2.3 JIT'] = runSymfonyDemo(true);
$data['Wordpress 6.2'] = runWordpress(false);
$data['Wordpress 6.2 JIT'] = runWordpress(true);
$data['Laravel'] = runLaravelDemo(false);
$data['Laravel JIT'] = runLaravelDemo(true);
$result = json_encode($data, JSON_PRETTY_PRINT) . "\n";

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

function runLaravelDemo(bool $jit): array {

$dir = __DIR__ . '/repos/laravel-demo-10.10';
cloneRepo($dir, 'https://github.com/nielsdos/laravel-demo-app.git');
runPhpCommand([$dir . '/artisan', 'config:cache']);
return runValgrindPhpCgiCommand('laravel-demo', [$dir . '/public/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 100);
}

function runPhpCommand(array $args, ?string $cwd = null): ProcessResult {
return runCommand([PHP_BINARY, ...$args], $cwd);
}
Expand Down