Tenjin
News
- (2008-02-27) pyTenjin 0.6.2 released (beta)
- (2008-02-27) plTenjin 0.0.2 released (alpha)
- (2008-02-24) phpTenjin 0.0.2 released (alpha)
- (2008-02-24) rbTenjin 0.6.2 released (beta)
- (2008-02-07) rbTenjin 0.6.1 released (beta)
- (2008-02-01) jsTenjin 0.0.2 released (alpha)
- (2007-10-23) pyTenjin 0.6.1 released (beta)
- (2007-08-04) pytenjin-0.6.0 released (beta)
- (2007-08-04) rbtenjin-0.6.0 released (beta)
- (2007-08-04) pltenjin-0.0.1 released (alpha)
- (2007-08-04) jstenjin-0.0.1 released (alpha)
- (2007-08-04) phptenjin-0.0.1 released (alpha)
Introduction
Tenjin is a very fast and full-featured template engine available in several script languages.
How fast Tenjin is? The following is a result of benchmark to generate 340 lines per page x 10,000 pages (this benchmark script is included in Tenjin package). Test#1 creates and destroys template object for each time. This test is intended to represent CGI. Test#2 creates template object only once and reuse it for each time. This test is intended to represent mod_perl, mod_python, or FastCGI.
| Language | Template Engine | Test#1(sec) | Test#2(sec) |
|---|---|---|---|
| Python(2.5.1) | pyTenjin (0.6.1) | 6.96 | 5.61 |
| Cheetah (2.0) | 20.36 | 19.82 | |
| Django (0.9.5) | 71.33 | 59.80 | |
| Myghty (1.1) | 107.88 | 19.30 | |
| Kid (0.9.6) | 380.24 | 378.96 | |
| Genshi (0.4.4) | 560.30 | 271.69 | |
| Mako (0.1.9) | 17.78 | 13.49 | |
| Templetor (web.py 0.22) | 428.19 | 61.53 | |
| Ruby(1.8.6) | rbTenjin (0.6.0) | 7.34 | 4.52 |
| eruby (1.0.5) | 12.29 | 11.53 | |
| ERB(def_method) (Ruby1.8.6) | 36.73 | 5.85 | |
| PHP(5.2.0) | phpTenjin (0.0.1) | 5.39 | 3.64 |
| Smarty (2.6.18) | 10.84 | 10.21 | |
| Perl(5.8.8) | plTenjin (0.0.1) | 10.42 | 5.72 |
| Template-Toolkit(XS) (2.18) | 103.58 | 26.30 | |
| HTML::Template (2.9) | 46.70 | 30.21 | |
| JS(spidermonkey) | jsTenjin (0.0.1) | 19.00 | 12.98 |
| JS(Rhino, JDK5) | jsTenjin (0.0.1) | 24.29 | 19.15 |
| Java(JDK5) | Velocity (1.4) | 22.80 | 11.41 |
| Velocity (1.5) | 20.01 | 8.42 |
The following is a graph to show number of pages per second.
This benchmark shows that Tenjin is about:
- 3 times faster than Cheetah.
- 3 times faster than Smarty.
- 5 times faster than Template-Toolkit.
- 9 times faster than Django.
- 60 times faster than Kid.
- Twice faster than Velocity. (Dynamic Java is slower than script languages!)
In addition to its high performance, Tenjin has the following features.
- Nestable layout template
- Include other templates
- Capture part of template and override layout template by captured content
- File caching and memory caching (functionalize) support
- Specifing template arguments (=variables passed from main programs)
- Preprocessing (which make your application much faster)
- YAML or JSON datafile support
- Available in Perl, Ruby, PHP, Perl, and JavaScript
See User's Guide and FAQ for details.
Download
You can download Tenjin from SourceForge.net
or RubyForge,
or type gem install tenjin if you are Ruby user.
- [Python] pyTenjin-0.6.2.tar.gz (2008-02-27)
- [Ruby] rbtenjin-0.6.2.tar.gz (2008-02-24)
- [PHP] phptenjin-0.0.2.tar.gz (2008-02-24)
- [Perl] pltenjin-0.0.2.tar.gz (2008-02-27)
- [JavaScript] jstenjin-0.0.2.tar.gz (2008-02-01)
Notice that Tenjin is still beta version. It means that API or specification of Tenjin may be changed in the future release.
Documents
- Changes
- (Python) (Ruby) (PHP) (Perl) (JavaScript)
- User's Guide
- (Python) (Ruby) (PHP) (Perl) (JavaScript)
- FAQ
- (Python) (Ruby) (PHP) (Perl) (JavaScript)
- Examples
- (Python) (Ruby) (PHP) (Perl) (JavaScript)
- Presentation
- 2007 LL Spirit LightningTalk (full-version) (Japanese)
License
- MIT License