[pypy-commit] extradoc extradoc: remove the reference to list strategies: it's not true, since self.data items are of type numpy.float64. Bah.
antocuni
pypy.commits at gmail.com
Mon Oct 30 06:19:09 EDT 2017
Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: extradoc
Changeset: r5854:03cc5eb071c6
Date: 2017-10-30 10:47 +0100
http://bitbucket.org/pypy/extradoc/changeset/03cc5eb071c6/
Log: remove the reference to list strategies: it's not true, since
self.data items are of type numpy.float64. Bah.
diff --git a/blog/draft/2017-10-how-to-make-80x-faster.rst b/blog/draft/2017-10-how-to-make-80x-faster.rst
--- a/blog/draft/2017-10-how-to-make-80x-faster.rst
+++ b/blog/draft/2017-10-how-to-make-80x-faster.rst
@@ -182,8 +182,7 @@
def __init__(self, *args, **kwargs):
Creature.__init__(self, *args, **kwargs)
- # store the data in a plain Python list, which pypy is able to
- # optimize as a float array
+ # store the data in a plain Python list
self.data = list(self.matrix.ravel()) + list(self.constant)
self.data_state = [0.0]
assert self.matrix.shape == (2, 3)
@@ -207,12 +206,7 @@
In the `actual code`_ there is also a sanity check which asserts that the
computed output is the very same as the one returned by ``Creature.run_step``.
-Note that is code is particularly PyPy-friendly. Thanks to PyPy's `list strategies`_
-optimizations, ``self.data`` as a simple list of floats is internally represented
-as a flat array of C doubles, i.e. very fast and compact.
-
.. _`actual code`: https://github.com/antocuni/evolvingcopter/blob/master/ev/creature.py#L100
-.. _`list strategies`: https://morepypy.blogspot.it/2011/10/more-compact-lists-with-list-strategies.html
So, let's try to see how it performs. First, with CPython:
More information about the pypy-commit
mailing list