[issue18682] [PATCH] remove bogus codepath from pprint._safe_repr

Antoine Pitrou report at bugs.python.org
Wed Aug 14 15:29:17 CEST 2013


Antoine Pitrou added the comment:

Ran some benchmark numbers:

$ ./python -m timeit -s "from pprint import saferepr; s='é\"x' * 1000" "saferepr(s)"
-> before patch: 555 usec per loop
-> after patch: 10.9 usec per loop

$ ./python -m timeit -s "from pprint import saferepr; s='xxx' * 1000" "saferepr(s)"
-> before patch: 290 usec per loop
-> after patch: 8.68 usec per loop

----------
nosy: +pitrou, serhiy.storchaka
stage:  -> patch review
versions: +Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18682>
_______________________________________


More information about the Python-bugs-list mailing list