Commits

Maciej Fijalkowski committed 4bd5e4d

work work work

Comments (0)

Files changed (2)

talk/pyconza2012/examples/calls.py

 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))
 
 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)
+

talk/pyconza2012/slides.rst

 
 |pause|
 
-* who some assembler
+* show some assembler
 
 |pause|
 
 * just joking
 
+Disclaimer
+----------
+
+* we're trying to make it better
+
 What is PyPy?
 -------------
 
 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