<br><br><div class="gmail_quote">On Mon, Aug 15, 2011 at 2:05 AM, Armin Rigo <span dir="ltr">&lt;<a href="mailto:arigo@tunes.org">arigo@tunes.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi David,<br>
<div class="im"><br>
On Sat, Aug 13, 2011 at 8:14 PM, David Naylor &lt;<a href="mailto:naylor.b.david@gmail.com">naylor.b.david@gmail.com</a>&gt; wrote:<br>
&gt; So, it appears pypy is failing to speed up this contrived example...<br>
<br>
</div>I think that it is expected, because the hash is computed entirely as<br>
pure Python code in the case of PyPy (doing integer arithmetic with<br>
overflow checks) whereas it is written in C in the case of RPython.  I<br>
find it rather good that we get overall close to the speed of CPython,<br>
given that we just have datetime.py...  Try using datetime.py on top<br>
of CPython too :-)<br>
<br>
More seriously, if we want to be really better with datetime objects,<br>
as opposed to &quot;good enough for now&quot;, then I fear we need to rewrite<br>
datetime.py in RPython, like CPython did rewrite it in C.  Or some<br>
intermediate solution is possible too, having an internal class which<br>
implements only basic operations (like hash) and which is subclassed<br>
in pure Python.  But I would happily leave that task to someone with<br>
an absolutely real need for high-performance datetime objects; for me<br>
&quot;good enough for now&quot; is good enough, for now...<br>
<br>
<br>
A bientôt,<br>
<font color="#888888"><br>
Armin.<br>
</font><div><div></div><div class="h5">_______________________________________________<br>
pypy-dev mailing list<br>
<a href="mailto:pypy-dev@python.org">pypy-dev@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pypy-dev" target="_blank">http://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div></div></blockquote></div><br>I&#39;d like to express that, unless we have a very compelling reason, we should try to keep more stuff in pure python, as opposed to RPython.  Mostly because it speeds up translation ;) (also easier to test, easier to write, etc.).<div>
<br></div><div>Alex<br clear="all"><div><br></div>-- <br>&quot;I disapprove of what you say, but I will defend to the death your right to say it.&quot; -- Evelyn Beatrice Hall (summarizing Voltaire)<br>&quot;The people&#39;s good is the highest law.&quot; -- Cicero<br>
<br>
</div>