How do I display unicode value stored in a string variable using ord()

Blind Anagram noname at nowhere.com
Sun Aug 19 14:04:49 EDT 2012


wrote in message 
news:5dfd1779-9442-4858-9161-8f1a06d56829 at googlegroups.com...

Le dimanche 19 août 2012 19:03:34 UTC+2, Blind Anagram a écrit :
> "Steven D'Aprano"  wrote in message
>
> news:502f8a2a$0$29978$c3e8da3$5496439d at news.astraweb.com...
>
>
>
> On Sat, 18 Aug 2012 01:09:26 -0700, wxjmfauth wrote:
>
>
>
> [...]
>
> If you can consistently replicate a 100% to 1000% slowdown in string
>
> handling, please report it as a performance bug:
>
>
>
> http://bugs.python.org/
>
>
>
> Don't forget to report your operating system.
>
>
>
> ====================================================
>
> For interest, I ran your code snippets on my laptop (Intel core-i7 1.8GHz)
>
> running Windows 7 x64.
>
>
>
> Running Python from a Windows command prompt,  I got the following on 
> Python
>
> 3.2.3 and 3.3 beta 2:
>
>
>
> python33\python" -m timeit "('abc' * 1000).replace('c', 'de')"
>
> 10000 loops, best of 3: 39.3 usec per loop
>
> python33\python" -m timeit "('ab…' * 1000).replace('…', '……')"
>
> 10000 loops, best of 3: 51.8 usec per loop
>
> python33\python" -m timeit "('ab…' * 1000).replace('…', 'x…')"
>
> 10000 loops, best of 3: 52 usec per loop
>
> python33\python" -m timeit "('ab…' * 1000).replace('…', 'œ…')"
>
> 10000 loops, best of 3: 50.3 usec per loop
>
> python33\python" -m timeit "('ab…' * 1000).replace('…', '€…')"
>
> 10000 loops, best of 3: 51.6 usec per loop
>
> python33\python" -m timeit "('XYZ' * 1000).replace('X', 'éç')"
>
> 10000 loops, best of 3: 38.3 usec per loop
>
> python33\python" -m timeit "('XYZ' * 1000).replace('Y', 'p?')"
>
> 10000 loops, best of 3: 50.3 usec per loop
>
>
>
> python32\python" -m timeit "('abc' * 1000).replace('c', 'de')"
>
> 10000 loops, best of 3: 24.5 usec per loop
>
> python32\python" -m timeit "('ab…' * 1000).replace('…', '……')"
>
> 10000 loops, best of 3: 24.7 usec per loop
>
> python32\python" -m timeit "('ab…' * 1000).replace('…', 'x…')"
>
> 10000 loops, best of 3: 24.8 usec per loop
>
> python32\python" -m timeit "('ab…' * 1000).replace('…', 'œ…')"
>
> 10000 loops, best of 3: 24 usec per loop
>
> python32\python" -m timeit "('ab…' * 1000).replace('…', '€…')"
>
> 10000 loops, best of 3: 24.1 usec per loop
>
> python32\python" -m timeit "('XYZ' * 1000).replace('X', 'éç')"
>
> 10000 loops, best of 3: 24.4 usec per loop
>
> python32\python" -m timeit "('XYZ' * 1000).replace('Y', 'p?')"
>
> 10000 loops, best of 3: 24.3 usec per loop
>
>
>
> This is an average slowdown by a factor of close to 2.3 on 3.3 when 
> compared
>
> with 3.2.
>
>
>
> I am not posting this to perpetuate this thread but simply to ask whether,
>
> as you suggest, I should report this as a possible problem with the beta?

I use win7 pro 32bits in intel?

Thanks for reporting these numbers.
To be clear: I'm not complaining, but the fact that
there is a slow down is a clear indication (in my mind),
there is a point somewhere.

====================================
I may be reading your input wrongly, but it seems to me that you are not 
only reporting a slowdown but you are also suggesting that this slowdown is 
the result of bad design decisions by the Python development team.

I don't want to get involved in the latter part of your argument because I 
am convinced that the Python team are doing their very best to find a good 
compromise between the various design constraints that they face in meeting 
these needs.

Nevertheless, the post that I responded to contained the suggestion that 
slowdowns above 100% (which I took as a factor of 2) would be worth 
reporting as a possible bug.  So I thought that it was worth asking about 
this as I may have misunderstood the level of slowdown that is worth 
reporting.  There is also a potential problem in timings on laptops with 
turbo-boost (as I have), although the times look fairly consistent.




More information about the Python-list mailing list