summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/pprint.py16
-rw-r--r--Misc/NEWS.d/next/Library/2022-07-06-21-24-03.gh-issue-92546.s5Upkh.rst2
2 files changed, 2 insertions, 16 deletions
diff --git a/Lib/pprint.py b/Lib/pprint.py
index 575688d..34ed126 100644
--- a/Lib/pprint.py
+++ b/Lib/pprint.py
@@ -637,19 +637,6 @@ def _recursion(object):
% (type(object).__name__, id(object)))
-def _perfcheck(object=None):
- import time
- if object is None:
- object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000
- p = PrettyPrinter()
- t1 = time.perf_counter()
- p._safe_repr(object, {}, None, 0, True)
- t2 = time.perf_counter()
- p.pformat(object)
- t3 = time.perf_counter()
- print("_safe_repr:", t2 - t1)
- print("pformat:", t3 - t2)
-
def _wrap_bytes_repr(object, width, allowance):
current = b''
last = len(object) // 4 * 4
@@ -666,6 +653,3 @@ def _wrap_bytes_repr(object, width, allowance):
current = candidate
if current:
yield repr(current)
-
-if __name__ == "__main__":
- _perfcheck()
diff --git a/Misc/NEWS.d/next/Library/2022-07-06-21-24-03.gh-issue-92546.s5Upkh.rst b/Misc/NEWS.d/next/Library/2022-07-06-21-24-03.gh-issue-92546.s5Upkh.rst
new file mode 100644
index 0000000..0ea676e
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-07-06-21-24-03.gh-issue-92546.s5Upkh.rst
@@ -0,0 +1,2 @@
+An undocumented ``python -m pprint`` benchmark is moved into ``pprint``
+suite of pyperformance. Patch by Oleg Iarygin.