<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Dec 17, 2013 at 8:43 AM, Stefan Krah <span dir="ltr"><<a href="mailto:stefan@bytereef.org" target="_blank">stefan@bytereef.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">Maciej Fijalkowski <<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>> wrote:<br>
> I would like to discuss on the language summit a potential inclusion<br>
> of cffi[1] into stdlib. This is a project Armin Rigo has been working<br>
> for a while, with some input from other developers.<br>
<br>
</div>I've tried cffi (admittedly only in a toy script) and find it very nice<br>
to use.<br>
<br>
Here's a comparison (pi benchmark) between wrapping libmpdec using a<br>
C-extension (_decimal), cffi and ctypes:<br>
<br>
<br>
+-------------------------------+----------+----------+---------+<br>
| | _decimal | ctypes | cffi |<br>
+===============================+==========+==========+=========+<br>
| cpython-tip (with-system-ffi) | 0.19s | 5.40s | 5.14s |<br>
+-------------------------------+----------+----------+---------+<br>
| cpython-2.7 (with-system-ffi) | n/a | 4.46s | 5.18s |<br>
+-------------------------------+----------+----------+---------+<br>
| Ubuntu-cpython-2.7 | n/a | 3.63s | - |<br>
+-------------------------------+----------+----------+---------+<br>
| pypy-2.2.1-linux64 | n/a | 125.9s | 0.94s |<br>
+-------------------------------+----------+----------+---------+<br>
| pypy3-2.1-beta1-linux64 | n/a | 264.9s | 2.93s |<br>
+-------------------------------+----------+----------+---------+<br>
<br>
<br>
I guess the key points are that C-extensions are hard to beat and that<br>
cffi performance on pypy-2 is outstanding. Additionally it's worth noting<br>
that Ubuntu does something in their Python build that we should do, too.<br></blockquote><div><br></div><div>Ubuntu compiles their Python with FDO (feedback directed optimization / profile guided optimization) enabled. All distros should do this if they don't already. It's generally 20% interpreter speedup. Our makefile already supports it but it isn't the default build as it takes a long time given that it needs to compile everything twice and do a profiled benchmark run between compilations.</div>
<div><br></div><div>-gps</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
+1 for cffi in the stdlib.<br>
<br>
<br>
<br>
Stefan Krah<br>
<div class="im"><br>
<br>
<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
</div><a href="https://mail.python.org/mailman/listinfo/python-dev" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/greg%40krypto.org" target="_blank">https://mail.python.org/mailman/options/python-dev/greg%40krypto.org</a><br>
</blockquote></div><br></div></div>