Skip to content

Commit aeee67f

Browse files
committed
Hello world benchmark for Laravel 5.8.14
0 parents  commit aeee67f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+9638
-0
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.yml]
15+
indent_size = 2

.env.example

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
LOG_CHANNEL=stack
8+
9+
DB_CONNECTION=mysql
10+
DB_HOST=127.0.0.1
11+
DB_PORT=3306
12+
DB_DATABASE=homestead
13+
DB_USERNAME=homestead
14+
DB_PASSWORD=secret
15+
16+
BROADCAST_DRIVER=log
17+
CACHE_DRIVER=file
18+
QUEUE_CONNECTION=sync
19+
SESSION_DRIVER=file
20+
SESSION_LIFETIME=120
21+
22+
REDIS_HOST=127.0.0.1
23+
REDIS_PASSWORD=null
24+
REDIS_PORT=6379
25+
26+
MAIL_DRIVER=smtp
27+
MAIL_HOST=smtp.mailtrap.io
28+
MAIL_PORT=2525
29+
MAIL_USERNAME=null
30+
MAIL_PASSWORD=null
31+
MAIL_ENCRYPTION=null
32+
33+
PUSHER_APP_ID=
34+
PUSHER_APP_KEY=
35+
PUSHER_APP_SECRET=
36+
PUSHER_APP_CLUSTER=mt1
37+
38+
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
39+
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

.gitattributes

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* text=auto
2+
*.css linguist-vendored
3+
*.scss linguist-vendored
4+
*.js linguist-vendored
5+
CHANGELOG.md export-ignore

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/node_modules
2+
/public/hot
3+
/public/storage
4+
/storage/*.key
5+
/vendor
6+
/.idea
7+
/.vscode
8+
/.vagrant
9+
Homestead.json
10+
Homestead.yaml
11+
npm-debug.log
12+
yarn-error.log
13+
.env
14+
.phpunit.result.cache
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace AbstractComponentConfiguration;
6+
7+
abstract class AbstractComponentConfiguration
8+
{
9+
public static function getComponentType(): int
10+
{
11+
return 2;
12+
}
13+
14+
public static function getComponentName(): string
15+
{
16+
return 'Laravel';
17+
}
18+
19+
public static function getComponentSlug(): string
20+
{
21+
return 'laravel';
22+
}
23+
24+
public static function isPhp56Enabled(): bool
25+
{
26+
return false;
27+
}
28+
29+
public static function isPhp70Enabled(): bool
30+
{
31+
return false;
32+
}
33+
34+
public static function isPhp71Enabled(): bool
35+
{
36+
return true;
37+
}
38+
39+
public static function isPhp72Enabled(): bool
40+
{
41+
return true;
42+
}
43+
44+
public static function isPhp73Enabled(): bool
45+
{
46+
return true;
47+
}
48+
49+
public static function getBenchmarkUrl(): string
50+
{
51+
return 'index.php/benchmark/helloworld';
52+
}
53+
54+
public static function getCoreDependencyName(): string
55+
{
56+
return 'laravel/framework';
57+
}
58+
59+
public static function getCoreDependencyMajorVersion(): int
60+
{
61+
return 5;
62+
}
63+
64+
public static function getCoreDependencyMinorVersion(): int
65+
{
66+
return 8;
67+
}
68+
69+
public static function getCoreDependencyPatchVersion(): int
70+
{
71+
return 14;
72+
}
73+
74+
public static function getBenchmarkType(): int
75+
{
76+
return 1;
77+
}
78+
79+
public static function getSourceCodeUrls(): array
80+
{
81+
return [
82+
'route' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_hello-world/Http/routes.php',
83+
'controller' => 'https://github.com/phpbenchmarks/laravel-common/blob/laravel_5_hello-world/Http/Controllers/HelloWorldController.php'
84+
];
85+
}
86+
}

.phpbenchmarks/initBenchmark.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
function clearCache() {
6+
rm -rf bootstrap/cache/*
7+
chmod -R 777 bootstrap/cache
8+
9+
php artisan clear-compiled
10+
php artisan view:clear
11+
php artisan route:clear
12+
php artisan config:clear
13+
php artisan cache:clear
14+
15+
if [ -d "storage/framework/sessions" ]; then
16+
rm -rf storage/framework/sessions
17+
fi
18+
mkdir storage/framework/sessions
19+
}
20+
21+
clearCache
22+
composer install --no-dev --classmap-authoritative
23+
clearCache
24+
php artisan config:cache
25+
php artisan route:cache
26+
27+
chmod -R 777 bootstrap/cache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World !

.phpbenchmarks/vhost.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
server {
2+
listen 80;
3+
server_name ____HOST____;
4+
root ____INSTALLATION_PATH____/public;
5+
location / {
6+
try_files $uri /index.php$is_args$args;
7+
}
8+
location ~ ^/(index).php(/|$) {
9+
fastcgi_pass unix:/run/php/____PHP_FPM_SOCK____;
10+
fastcgi_split_path_info ^(.+.php)(/.*)$;
11+
include fastcgi_params;
12+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
13+
fastcgi_param HTTPS off;
14+
}
15+
error_log /var/log/nginx/benchmark_error.log;
16+
access_log /var/log/nginx/benchmark_access.log;
17+
}

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<p align="center">
2+
<img src="http://www.phpbenchmarks.com/images/logo_github.png">
3+
<br>
4+
<a href="http://www.phpbenchmarks.com" target="_blank">www.phpbenchmarks.com</a>
5+
</p>
6+
7+
## What is www.phpbenchmarks.com ?
8+
9+
You will find lot of benchmarks for PHP frameworks and template engines.
10+
11+
You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.3.
12+
13+
## What is this repository ?
14+
15+
It's benchmark common code for Laravel benchmarks.
16+
17+
Switch branch to select your Laravel major version and benchmark you want to see.
18+
19+
See all Laravel benchmarked versions on [phpbenchmarks/laravel](https://github.com/phpbenchmarks/laravel).
20+
21+
You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html).
22+
23+
## Benchmarks
24+
25+
You can find all Laravel benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/laravel.html).
26+
27+
Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark !

app/Console/Kernel.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace App\Console;
4+
5+
use Illuminate\Console\Scheduling\Schedule;
6+
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
7+
8+
class Kernel extends ConsoleKernel
9+
{
10+
/**
11+
* The Artisan commands provided by your application.
12+
*
13+
* @var array
14+
*/
15+
protected $commands = [
16+
//
17+
];
18+
19+
/**
20+
* Define the application's command schedule.
21+
*
22+
* @param \Illuminate\Console\Scheduling\Schedule $schedule
23+
* @return void
24+
*/
25+
protected function schedule(Schedule $schedule)
26+
{
27+
// $schedule->command('inspire')
28+
// ->hourly();
29+
}
30+
31+
/**
32+
* Register the commands for the application.
33+
*
34+
* @return void
35+
*/
36+
protected function commands()
37+
{
38+
$this->load(__DIR__.'/Commands');
39+
40+
require base_path('routes/console.php');
41+
}
42+
}

0 commit comments

Comments
 (0)