From 49a9402d164832d214546976f26d6c18cb754a45 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Tue, 17 Oct 2023 21:14:45 +0200 Subject: [PATCH 1/2] Add Laravel demo page to 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. --- benchmark/benchmark.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index a0c01ca766233..c888bfb412ce1 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -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); @@ -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); } From d47a373b24dd450f1fcb13059836505bb99ac480 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 18 Oct 2023 09:28:56 +0200 Subject: [PATCH 2/2] Tweak commands and put version in name --- benchmark/benchmark.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmark/benchmark.php b/benchmark/benchmark.php index c888bfb412ce1..a41f8b7e13b7b 100644 --- a/benchmark/benchmark.php +++ b/benchmark/benchmark.php @@ -27,8 +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); + $data['Laravel 10.10'] = runLaravelDemo(false); + $data['Laravel 10.10 JIT'] = runLaravelDemo(true); $result = json_encode($data, JSON_PRETTY_PRINT) . "\n"; fwrite(STDOUT, $result); @@ -96,6 +96,9 @@ 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']); + runPhpCommand([$dir . '/artisan', 'event:cache']); + runPhpCommand([$dir . '/artisan', 'route:cache']); + runPhpCommand([$dir . '/artisan', 'view:cache']); return runValgrindPhpCgiCommand('laravel-demo', [$dir . '/public/index.php'], cwd: $dir, jit: $jit, warmup: 50, repeat: 100); }