Author: Brian Kearns <[email protected]>
Branch: 
Changeset: r62737:fd57a72ffc21
Date: 2013-03-25 04:51 -0400
http://bitbucket.org/pypy/pypy/changeset/fd57a72ffc21/

Log:    unroll these list operations like tuple does

diff --git a/pypy/objspace/std/listobject.py b/pypy/objspace/std/listobject.py
--- a/pypy/objspace/std/listobject.py
+++ b/pypy/objspace/std/listobject.py
@@ -1468,6 +1468,11 @@
     w_list.inplace_mul(times)
     return w_list
 
+def list_unroll_condition(space, w_list1, w_list2):
+    return jit.loop_unrolling_heuristic(w_list1, w_list1.length()) or \
+           jit.loop_unrolling_heuristic(w_list2, w_list2.length())
+
[email protected]_inside_iff(list_unroll_condition)
 def eq__List_List(space, w_list1, w_list2):
     # needs to be safe against eq_w() mutating the w_lists behind our back
     if w_list1.length() != w_list2.length():
@@ -1485,6 +1490,8 @@
 def _make_list_comparison(name):
     import operator
     op = getattr(operator, name)
+
+    @jit.look_inside_iff(list_unroll_condition)
     def compare_unwrappeditems(space, w_list1, w_list2):
         # needs to be safe against eq_w() mutating the w_lists behind our back
         # Search for the first index where items are different
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to