Commits

Brian Kearns  committed 394d0df

unroll these set operations like list does

  • Participants
  • Parent commits 1f7ca87

Comments (0)

Files changed (1)

File pypy/objspace/std/setobject.py

 
 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
         """ 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:
 
     _pick_correct_strategy(space, w_set, iterable_w)
 
+@jit.look_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: