https://github.com/ericmorand/twing-benchmark
twig.js versus Twing benchmark
https://github.com/ericmorand/twing-benchmark
benchmark twig twigjs twing
Last synced: 3 months ago
JSON representation
twig.js versus Twing benchmark
- Host: GitHub
- URL: https://github.com/ericmorand/twing-benchmark
- Owner: ericmorand
- Created: 2018-03-20T18:16:44.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-09-30T12:42:33.000Z (almost 8 years ago)
- Last Synced: 2025-01-26T17:11:19.332Z (over 1 year ago)
- Topics: benchmark, twig, twigjs, twing
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
twig.js versus Twing benchmark
==============================
A comparison benchmark of the latest versions of [twig.js](https://github.com/twigjs/twig.js) and [Twing](https://github.com/ericmorand/twing).
## The protocol
This benchmark is based on the [Smarty versus TwigPHP benchmark](https://github.com/dominics/smarty-twig-benchmark) by dominics:
* Extending one base template and overriding its blocks
* 3 blocks, with varying default content
* A single for loop, outputting elements of an array within one block
## Usage
`npm install`
`npm start`
## Results
On my machine, with twig.js ^1.12.0 and Twing ^2.0.0, node.js 10.9.0, 100000 iterations, compile time ignored, cache warmed:
Benchmark | Time Taken
--- | ---
twig.js | ~5 seconds
Twing | ~0.6 second
As a matter of comparison, here are the results I get from Smarty versus TwigPHP benchmark on the same machine with TwigPHP 2.5.0, PHP 7.1.17, 100000 iterations, compile time ignored, cache warmed:
Benchmark | Time Taken
--- | ---
TwigPHP | ~0.8 second