Skip to content

Commit 7dd0ef2

Browse files
steevanbSteevan BARBOYON
authored and
Steevan BARBOYON
committed
Create Hello world benchamrk
0 parents  commit 7dd0ef2

File tree

5 files changed

+56
-0
lines changed

5 files changed

+56
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.idea/
2+
vendor/

README.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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.2.
12+
13+
## What is this repository ?
14+
15+
It's benchmark common code for Twig benchmarks.
16+
17+
Switch branch to select your Twig major version and benchmark you want to see.
18+
19+
See all Twig benchmarked versions on [phpbenchmarks/twig](https://github.com/phpbenchmarks/twig).
20+
21+
You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html).
22+
23+
## How versions works ?
24+
25+
We do not follow semantic version for this repository. Here is an explanation about our versioning system:
26+
27+
`X` related to Twig major version (`1` Twig ^1, `2` Twig ^2)
28+
29+
`Y` benchmark type (`1` Hello World)
30+
31+
`Z` new version, not just bugfix and could contains BC
32+
33+
## Benchmarks
34+
35+
You can find all Twig benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/twig.html).
36+
37+
Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark !

composer.json

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "phpbenchmarks/twig-common",
3+
"type": "project",
4+
"license": "proprietary",
5+
"require": {
6+
"twig/twig": "^2.0"
7+
}
8+
}

helloworld.php

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
3+
$twig = new Twig_Environment(
4+
new Twig_Loader_Filesystem(__DIR__ . '/templates'),
5+
['cache' => $cacheDir]
6+
);
7+
8+
echo $twig->render('helloworld.html.twig');

templates/helloworld.html.twig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello World !

0 commit comments

Comments
 (0)