Author: Alex Gaynor <[email protected]>
Branch: 
Changeset: r66705:a8c20c575491
Date: 2013-08-30 16:23 -0700
http://bitbucket.org/pypy/pypy/changeset/a8c20c575491/

Log:    Unroll dict.keys() when the length is known and small.

diff --git a/pypy/objspace/std/dictmultiobject.py 
b/pypy/objspace/std/dictmultiobject.py
--- a/pypy/objspace/std/dictmultiobject.py
+++ b/pypy/objspace/std/dictmultiobject.py
@@ -433,6 +433,8 @@
     def get_empty_storage(self):
         raise NotImplementedError
 
+    @jit.look_inside_iff(lambda self, w_dict:
+                         w_dict_unrolling_heuristic(w_dict))
     def w_keys(self, w_dict):
         iterator = self.iterkeys(w_dict)
         result = newlist_hint(self.length(w_dict))
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to