unicode() vs. s.decode()

1x7y2z9 1x7y2z9 at gmail.com
Wed Aug 5 14:12:45 EDT 2009


unicode() has LOAD_GLOBAL which s.decode() does not.  Is it generally
the case that LOAD_ATTR is slower than LOAD_GLOBAL that lead to your
intuition that the former would probably be slower?  Or some other
intuition?
Of course, the results from timeit are a different thing - I ask about
the intuition in the disassembler output.
Thanks.

>
> The presence of LOAD_ATTR in the first form hints that this is probably
> going to be slower.   Next, actually try it:
>



More information about the Python-list mailing list