This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Speedup test_unparse
Type: performance Stage: resolved
Components: Tests Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: jkloth, pablogsal, vstinner
Priority: normal Keywords: patch

Created on 2022-03-26 19:15 by jkloth, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 32132 merged jkloth, 2022-03-26 19:19
Messages (3)
msg416082 - (view) Author: Jeremy Kloth (jkloth) * Date: 2022-03-26 19:15
The string building and comparing of ast.dump() causes significant slowdowns on the large ASTs produced when doing the roundtrip test on the stdlib.

This PR avoids that cost by doing a direct node traversal and comparison.  It results in a 33% runtime improvement on machines to which I have access.
msg416529 - (view) Author: Pablo Galindo Salgado (pablogsal) * (Python committer) Date: 2022-04-02 01:54
New changeset 0f68c208fa6a36b6c8ad3d775e64292a665ba108 by Jeremy Kloth in branch 'main':
bpo-47131: Speedup AST comparisons in test_unparse by using node traversal (GH-32132)
https://github.com/python/cpython/commit/0f68c208fa6a36b6c8ad3d775e64292a665ba108
msg416791 - (view) Author: Jeremy Kloth (jkloth) * Date: 2022-04-05 17:32
Resolved with merged PR.
History
Date User Action Args
2022-04-11 14:59:57adminsetgithub: 91287
2022-04-05 17:32:41jklothsetstatus: open -> closed
stage: patch review -> resolved
2022-04-05 17:32:24jklothsetresolution: fixed
messages: + msg416791
2022-04-02 01:54:08pablogsalsetnosy: + pablogsal
messages: + msg416529
2022-03-26 19:20:31jklothsetnosy: + vstinner
type: performance
2022-03-26 19:19:10jklothsetkeywords: + patch
stage: patch review
pull_requests: + pull_request30212
2022-03-26 19:15:49jklothcreate