More tests and data.<br><br>I&#39;ve simply cached some values and started to see improvements which was strange... (it means that somehow the trellis component recomputes some of the measurements or provides a way slower access to the results)<br>
<br>then I pushed some of the cache code in an exterior method and timed it for both versions. <br><br>here is the code:<br>#------- start code<br>import timeit<br>stmt = &quot;&quot;&quot;<br>def render_nimf_distance_anim(mp):<br>
&nbsp;&nbsp;&nbsp; n_hdev = mp.n_hdev<br>&nbsp;&nbsp;&nbsp; n_hdev2 = mp.n_hdev2<br>&nbsp;&nbsp;&nbsp; n_vdev = mp.n_vdev<br>&nbsp;&nbsp;&nbsp; n_vdev2 = mp.n_vdev2<br>&nbsp;&nbsp;&nbsp; breast_base_h = mp.breast_base_h<br>&nbsp;&nbsp;&nbsp; breast_base_h2 = mp.breast_base_h2<br>&nbsp;&nbsp;&nbsp; lower_pole = mp.lower_pole <br>
&nbsp;&nbsp;&nbsp; lower_pole2 = mp.lower_pole2 <br>&nbsp;&nbsp;&nbsp; lower_pole_base = mp.lower_pole_base<br>&nbsp;&nbsp;&nbsp; lower_pole_base2 = mp.lower_pole_base2<br>&nbsp;&nbsp;&nbsp; lower_pole_with_ptosis = mp.lower_pole_with_ptosis<br>&nbsp;&nbsp;&nbsp; lower_pole_with_ptosis2 = mp.lower_pole_with_ptosis2<br>
&nbsp;&nbsp;&nbsp; future_nimf = mp.future_nimf<br>&nbsp;&nbsp;&nbsp; future_nimf2 = mp.future_nimf2<br>&nbsp;&nbsp;&nbsp; future_imf_pos = mp.future_imf_pos<br>&nbsp;&nbsp;&nbsp; future_imf_pos2 = mp.future_imf_pos2<br>&nbsp;&nbsp;&nbsp; incision_pos = mp.incision_pos<br>&nbsp;&nbsp;&nbsp; incision_pos2 = mp.incision_pos2<br>
<br>from measurements import Measurements, MeasurementsProxy<br><br>m = Measurements()<br>mp = MeasurementsProxy()<br>for x in range(100):<br>&nbsp;&nbsp;&nbsp; render_nimf_distance_anim(mp)&quot;&quot;&quot;<br>t = timeit.Timer(stmt=stmt)<br>
print t.timeit(number=10)<br><br>#------- end code<br><br>the results were:<br>0.7a2: 36.40 seconds<br>0.6a3: 0.55 seconds<br><br>The only thing I modified was replacing trellis.values with trellis.attrs and trellis.rule with trellis.compute (trellis.rules with trellis.compute.attrs)<br>
<br>Any ideas?<br><br>Peter<br><br><br><div class="gmail_quote">On Wed, Jun 18, 2008 at 11:55 AM, Peter Damoc &lt;<a href="mailto:pdamoc@gmail.com">pdamoc@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I took the dive today and updated the code to the new Trellis format. <br>In the end it wasn&#39;t as bad as I thought it be from a code change point of view. <br><br>Unfortunately now I&#39;m seeing an almost 10 fold decrease in the performance of my code. <br>

Nothing is change except the trellis adaptation to the new API.<br>Before change, using Trellis 0.6a3, I got something like 40 ms execution of a drawing method. Now I&#39;m getting 344 ms with 0.7a2.<br><br>My trellis component is basically comprised of a dictionary containing a series of measurements and a group of attrs and compute attrs that use these measurements to output the drawing parameters. (around 400 LOC) <br>

<br>Any idea about how should I approach this predicament is welcomed. <br>What should I try?<br><br>Peter<br><font color="#888888"><br>-- <br>There is NO FATE, we are the creators.
</font></blockquote></div><br><br clear="all"><br>-- <br>There is NO FATE, we are the creators.