Not to my knowledge. The most recent release has significant Java
backend performance improvements over the first release, so any
benchmarks done against the first release should be considered
obsolete.
http://code.google.com/p/closure-templates/source/detail?r=20
> 2. I dont want to compile a SoyTofu object on every servlet request,
> so i was thinking of shoving it in a static member? Will this work, is
> the soytofu rendering thread agnostic? (that is can two renders happen
> with the same tofu object in different threads at the same time?)
Yes. SoyTofu is thread-safe, but the renderers returned by newRenderer are not.
It was designed so that you can do
static final SoyTofu MY_COMPILED_TEMPLATE = ...;
and have many threads in parallel do
MY_COMPILED_TEMPLATE.newRenderer(....)....render()
> 3. More a general knowledge question, does google internally use soy
> templates in their servlet code? Any opensource project pointers?
Google does use closure templates internally.
Chapter 6 of http://www.cs.berkeley.edu/~prateeks/papers/csas-ccs11.pdf
has some publicly released stats:
"""
Closure Templates are used extensively in large web applications in-
cluding Gmail, Google Docs and other Google properties.
...
For real-world evaluation, we gath-
ered all Closure templates accessible to us. Our benchmarks
consist of 1035 distinct Closure templates from Google's
commericially deployed applications. The templates were
authored by developers prior to our CSAS engine implemen-
tation. Therefore, we believe that these examples represent
unbiased samples of existing code written in templating lan-
guages.
The total amount of code in the templates (excluding le
prologues and comments outside the templates) is 21; 098
LOC. Our benchmarks make heavy use of flow control con-
structs such as callTemplate calls. Our benchmark's tem-
plate call-graph is densely connected. It consists of 1035
nodes, 2997 call edges and 32 connected components of size
ranging from 2 - 12 templates and one large component with
633 templates.
"""
That case study is based on an analysis of Google code done some time
ago, and I can now say that Google+ is one of the projects that use
Closure templates.
I don't know of any survey of open source projects that use closure
templates, but http://www.google.com/codesearch#search/&q=import%20com.google.template.soy&type=cs
might help you find some pointers to projects that use the java
backend.
> Thanks,
> -Prakash
To add to this.
https://plus.google.com/u/0/115060278409766341143/posts/ViaVbBMpSVG :
"""
1. We <3 Closure
We like Closure. A lot. We use the Closure library, templates, and
compiler to render every element on every page in Google+ -- including
the JavaScript that powers these pages. But what really helps us go
fast is the following:
- Closure templates can be used in both Java and JavaScript to render
pages server-side and in the browser. This way, content always appears
right away, and we can load JavaScript in the background ("decorating"
the page, and hooking up event listeners to elements along the way)
...
"""