Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r62736:394d0dfa0fc6
Date: 2013-03-25 03:43 -0400
http://bitbucket.org/pypy/pypy/changeset/394d0dfa0fc6/

Log:    unroll these set operations like list does

diff --git a/pypy/objspace/std/setobject.py b/pypy/objspace/std/setobject.py
--- a/pypy/objspace/std/setobject.py
+++ b/pypy/objspace/std/setobject.py
@@ -13,7 +13,7 @@
 
 from rpython.rlib.objectmodel import r_dict
 from rpython.rlib.rarithmetic import intmask, r_uint
-from rpython.rlib import rerased
+from rpython.rlib import rerased, jit
 
 class W_BaseSetObject(W_Object):
     typedef = None
@@ -390,6 +390,8 @@
         """ Returns a wrapped version of the given unwrapped item. """
         raise NotImplementedError
 
+    @jit.look_inside_iff(lambda self, list_w:
+                         jit.loop_unrolling_heuristic(list_w, len(list_w)))
     def get_storage_from_list(self, list_w):
         setdata = self.get_empty_dict()
         for w_item in list_w:
@@ -1026,6 +1028,8 @@
 
     _pick_correct_strategy(space, w_set, iterable_w)
 
[email protected]_inside_iff(lambda space, w_set, iterable_w:
+                     jit.loop_unrolling_heuristic(iterable_w, len(iterable_w)))
 def _pick_correct_strategy(space, w_set, iterable_w):
     # check for integers
     for w_item in iterable_w:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to