Author: Antonio Cuni <[email protected]>
Branch: refactor-str-types
Changeset: r68703:ec53889e6f05
Date: 2014-01-17 00:29 +0100
http://bitbucket.org/pypy/pypy/changeset/ec53889e6f05/

Log:    (antocuni, mjacob): add a fastpath for strings, trying to fix the
        slowdown that we observe in things like unicode_string+byte_string

diff --git a/pypy/objspace/std/unicodeobject.py 
b/pypy/objspace/std/unicodeobject.py
--- a/pypy/objspace/std/unicodeobject.py
+++ b/pypy/objspace/std/unicodeobject.py
@@ -88,6 +88,8 @@
     def _op_val(self, space, w_other):
         if isinstance(w_other, W_UnicodeObject):
             return w_other._value
+        if space.isinstance_w(w_other, space.w_str):
+            return unicode_from_string(space, w_other)._value
         return unicode_from_encoded_object(space, w_other, None, 
"strict")._value
 
     def _chr(self, char):
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to