diff options
author | Oleg Iarygin <oleg@arhadthedev.net> | 2022-07-25 18:30:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-25 18:30:13 (GMT) |
commit | c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd (patch) | |
tree | 0066dbccd26b38181ac832ae5cf12bcfadf02f55 /Lib/pprint.py | |
parent | 4e704d7847f2333f581f87e31b42e44a471df93a (diff) | |
download | cpython-c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd.zip cpython-c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd.tar.gz cpython-c5140945c723ae6c4b7ee81ff720ac8ea4b52cfd.tar.bz2 |
gh-92546: Move pprint benchmark into pyperformance (GH-94613)
This PR couples with https://github.com/python/pyperformance/pull/222 and supersedes https://github.com/python/cpython/pull/92560. Inspired by https://github.com/python/cpython/issues/93096#issuecomment-1134576471.
Automerge-Triggered-By: GH:ericsnowcurrently
Diffstat (limited to 'Lib/pprint.py')
-rw-r--r-- | Lib/pprint.py | 16 |
1 files changed, 0 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() |