<br><br><div><span class="gmail_quote">On 2/18/06, <b class="gmail_sendername">Todd Thomas</b> &lt;<a href="mailto:caliban19@gmail.com">caliban19@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><span class="e" id="q_1097ed58e0e6879f_0"><br><br><div><span class="gmail_quote">On 2/15/06, <b class="gmail_sendername">Matt Helm</b> &lt;<a href="mailto:code.name.eric@gmail.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
code.name.eric@gmail.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 2/14/06, L. Daniel Burr &lt;<a href="mailto:ldanielburr@mac.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">ldanielburr@mac.com</a>&gt; wrote:<br><br>&gt; Probably.&nbsp;&nbsp;Rendering your template in this way will most certainly block
<br>&gt; the reactor, since Cheetah templates don't support Deferreds.&nbsp;&nbsp;On the
<br>&gt; other hand, if the template is rendering *very* quickly, then this code<br>&gt; might not block for long enough to actually matter.<br><br>That is what I suspected. I will call the Cheetah template in deferToThread.
<br><br>Matt.<br><br>_______________________________________________<br>Twisted-web mailing list<br><a href="mailto:Twisted-web@twistedmatrix.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Twisted-web@twistedmatrix.com
</a><br><a href="http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-web</a><br></blockquote></div></span></div>Why
not just compile your template at the head of the file using,
Template.compile(file=&quot;path&quot;). I did some experimentation with this,
and it is very fast. Only time I could see where deferred would be
useful is when you are compiling it initially, if you precompile your
templates and dont call any blocking functions within it, it will be
more than fast enough.<br>
<br>
ToddB<br>

</blockquote></div>One other thing, rpy will automatically cache the
instance you create if its in your resource class. Which means you will
only take the hit once when initially creating class. So it may block
briefly depending on size of template, but afterwards, should be as
fast as calling request.write on a class directly, which is basically
what your are doing.<br>
<br>
ToddB<br>