惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
Jina AI
Jina AI
雷峰网
雷峰网
Blog — PlanetScale
Blog — PlanetScale
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
博客园 - 司徒正美
罗磊的独立博客
J
Java Code Geeks
Engineering at Meta
Engineering at Meta
WordPress大学
WordPress大学
Vercel News
Vercel News
A
About on SuperTechFans
I
InfoQ
D
DataBreaches.Net
爱范儿
爱范儿
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
U
Unit 42
aimingoo的专栏
aimingoo的专栏
宝玉的分享
宝玉的分享
P
Proofpoint News Feed
Microsoft Azure Blog
Microsoft Azure Blog
美团技术团队

Secret Weblog

Becoming More Xee: A Modern XPath and XSLT Engine in Rust Looking for new challenges! Repeat Yourself, A Bit The Curious Case of Quentell The Humble For Loop in Rust The Humble For Loop in JavaScript Don Question Best Practices I Was a 1980s Teenage Programmer Part 5: Achieving Assembly I Was a 1980s Teenage Programmer Part 4: The Call of Assembly The Tooling Shift I Was a 1980s Teenage Programmer Part 3: MSX-2 JavaScript: when you need two ways to do it! Empowering Programming Languages Bloat and Retrofuturism Refreshing my Blog Again Random Rust Impressions Apilar: An Alife System I Was a 1980s Teenage Programmer Part 2: Olivetti M24 I Was a 1980s Teenage Programmer: the Alphatronic SolidJS fits my brain Is premature optimization the root of all evil? Framework Patterns: JavaScript edition Roll Your Own Frameworks Framework Patterns Secret Weblog Highlights Refactoring to Multiple Exit Points mstform: a form library for mobx-state-tree Seven Years: A Very Personal History of the Web
Clarity, ClearSilver integration for Zope 3
Martijn Faassen · 2005-04-15 · via Secret Weblog

I've just checked in a new package into the Zope 3 base subversion repository called Clarity. What it does is integrate ClearSilver templating into Zope 3 (trunk, though I expect Zope X3.0 or even Five support should be easy enough). It's all still rough, but initial tests show ClearSilver templates can be quite a bit faster than ZPT, and they have other possible benefits. In my simplistic experiments I got transaction rates about 2 to 5 times higher than you can reach with ZPT, testing this with the 'siege' utility.

Here's an extract from the README that describes the motivation for this experiment.

Why?

Zope 3 already has page template and even DTML, why would I want to use this? Some possible benefits ClearSilver brings are:

  • Absolute separation of logic from template. You cannot do complicated logic in a ClearSilver template, you can only extract data. You cannot call into the Zope 3 API at all.
  • Increased debuggability. Calling APIs is impossible from the template, which means that most bugs the API should appear in Python code already, where the programmer can worry about them, not the person who is tweaking the templates. While you are building a template you will never be bothered by, say, ComponentLookupErrors.
  • Increased testability. Since you know what HDF structure you expect to get in advance, you can test this using a normal unit test from Python code. Your template can stay simple.
  • Performance. Admittedly simplistic testing with 'siege' shows that for larger templates, ClearSilver templates integrated into Zope run several times faster than the equivalent ZPT page.

However, since no significant codebases exist that use this facility, these benefits are somewhat speculative.

More info and download

More about ClearSilver here:

http://www.clearsilver.net

A comparison with other templating system and a motivation for its design, which they call dataset driven templates, can be found here.

Among other systems which use ClearSilver templates is Trac, the Python-based software project management tool:

http://projects.edgewall.com/trac/

You can check out Clarity from the Zope 3 base, here:

http://codespeak.net/svn/z3/clarity/trunk/