Skip to content

Commit

Permalink
Create Hello world benchamrk
Browse files Browse the repository at this point in the history
  • Loading branch information
steevanb authored and Steevan BARBOYON committed Apr 26, 2018
0 parents commit 7dd0ef2
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
vendor/
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<p align="center">
<img src="http://www.phpbenchmarks.com/images/logo_github.png">
<br>
<a href="http://www.phpbenchmarks.com" target="_blank">www.phpbenchmarks.com</a>
</p>

## What is www.phpbenchmarks.com ?

You will find lot of benchmarks for PHP frameworks and template engines.

You can compare results between Apache Bench and Siege, and PHP 5.6 to 7.2.

## What is this repository ?

It's benchmark common code for Twig benchmarks.

Switch branch to select your Twig major version and benchmark you want to see.

See all Twig benchmarked versions on [phpbenchmarks/twig](https://github.com/phpbenchmarks/twig).

You can find how we benchmark on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark-protocol.html).

## How versions works ?

We do not follow semantic version for this repository. Here is an explanation about our versioning system:

`X` related to Twig major version (`1` Twig ^1, `2` Twig ^2)

`Y` benchmark type (`1` Hello World)

`Z` new version, not just bugfix and could contains BC

## Benchmarks

You can find all Twig benchmarks results on [phpbenchmarks.com](http://www.phpbenchmarks.com/en/benchmark/twig.html).

Scores are too low ? Do not hesitate to create a pull request, and ask a new benchmark !
8 changes: 8 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "phpbenchmarks/twig-common",
"type": "project",
"license": "proprietary",
"require": {
"twig/twig": "^2.0"
}
}
8 changes: 8 additions & 0 deletions helloworld.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

$twig = new Twig_Environment(
new Twig_Loader_Filesystem(__DIR__ . '/templates'),
['cache' => $cacheDir]
);

echo $twig->render('helloworld.html.twig');
1 change: 1 addition & 0 deletions templates/helloworld.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hello World !

0 comments on commit 7dd0ef2

Please sign in to comment.