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

Terry Reedy tjreedy at udel.edu
Sat Aug 18 23:12:50 EDT 2012


On 8/18/2012 4:09 PM, Terry Reedy wrote:

> print(timeit("c in a", "c  = '…'; a = 'a'*1000+c"))
> # .6 in 3.2.3, 1.2 in 3.3.0
>
> This does not make sense to me and I will ask about it.

I did ask on pydef list and paraphrased responses include:
1. 'My system gives opposite ratios.'
2. 'With a default of 1000000 repetitions in a loop, the reported times 
are microseconds per operation and thus not practically significant.'
3. 'There is a stringbench.py with a large number of such micro benchmarks.'

I believe there are also whole-application benchmarks that try to mimic 
real-world mixtures of operations.

People making improvements must consider performance on multiple systems 
and multiple benchmarks. If someone wants to work on search speed, they 
cannot just optimize that one operation on one system.

-- 
Terry Jan Reedy





More information about the Python-list mailing list