New submission from Antoine Pitrou <pit...@free.fr>:

This patch optimizes scanning for the max character width in an unicode buffer.

Micro-benchmarking some worst case situations:

$ ./python -m timeit -s "x='é'+'x'*100000" "x[1:]"
-> before:
10000 loops, best of 3: 74.9 usec per loop
-> after:
100000 loops, best of 3: 15.5 usec per loop

$ ./python -m timeit -s "x='\U00010000'+'x'*100000" "x[1:]"
-> before:
10000 loops, best of 3: 138 usec per loop
-> after:
10000 loops, best of 3: 71.3 usec per loop

----------
components: Interpreter Core
files: find_max_char.patch
keywords: patch
messages: 145372
nosy: pitrou
priority: normal
severity: normal
status: open
title: Optimize finding the max character width
type: performance
versions: Python 3.3
Added file: http://bugs.python.org/file23379/find_max_char.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13155>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to