[pypy-commit] extradoc extradoc: work work work
fijal
noreply at buildbot.pypy.org
Wed Oct 3 17:09:13 CEST 2012
Author: Maciej Fijalkowski <fijall at gmail.com>
Branch: extradoc
Changeset: r4834:4bd5e4d143e3
Date: 2012-10-03 17:02 +0200
http://bitbucket.org/pypy/extradoc/changeset/4bd5e4d143e3/
Log: work work work
diff --git a/talk/pyconza2012/examples/calls.py b/talk/pyconza2012/examples/calls.py
--- a/talk/pyconza2012/examples/calls.py
+++ b/talk/pyconza2012/examples/calls.py
@@ -10,6 +10,9 @@
def simple_call2(a, b, c):
inner(a, c=c, b=b)
+def simple_method(a, b, c):
+ c.m(a, b)
+
def star_call(a, b, c):
inner(*(a, b, c))
@@ -19,14 +22,20 @@
def abomination(a, b, c):
inner(**locals())
+class A(object):
+ def m(self, a, b):
+ pass
+
def run(func):
count = int(sys.argv[1])
t0 = time.time()
+ o = A()
for i in range(count):
- func(i, i, i)
+ func(i, i, o)
tk = time.time()
t = (tk - t0) / count
- print "%.2e per call, %d cycles" % (t, int(t * 1.7e9))
+ print "%s %.2e per call, %d cycles" % (func.func_name, t, int(t * 1.7e9))
-for f in [simple_call, simple_call2, star_call, star_call_complex, abomination]:
+for f in [simple_call, simple_call2, simple_method, star_call, star_call_complex, abomination]:
run(f)
+
diff --git a/talk/pyconza2012/slides.rst b/talk/pyconza2012/slides.rst
--- a/talk/pyconza2012/slides.rst
+++ b/talk/pyconza2012/slides.rst
@@ -22,12 +22,17 @@
|pause|
-* who some assembler
+* show some assembler
|pause|
* just joking
+Disclaimer
+----------
+
+* we're trying to make it better
+
What is PyPy?
-------------
@@ -124,5 +129,29 @@
Attribute access
----------------
+* if optimized, almost as fast as local var access
+
+* ``dict`` lookup optimized away
+
+* class attributes considered constant
+
+* meta programming is better than dynamism
+
+* objects for small number of constant keys, dicts for large
+ numbers of changing keys
+
Other sorts of loops
--------------------
+
+* there is more!
+
+* ``tuple(iterable)``, ``map(iterable)``, ``re.search``
+
+* they're all jitted
+
+* not all nicely
+
+Future improvements
+-------------------
+
+Xxxx
More information about the pypy-commit
mailing list