GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Speed up `pprint` on deeply nested containers · Issue #161114 · python/cpython Open Labels performancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:
import json, pprint, time flat = json.loads("[" + ",".join(["1"] * 20000) + "]") deep = json.loads("[" * 300 + ",".join(["1"] * 20000) + "]" * 300) for o in flat, deep: t = time.perf_counter(); pprint.pformat(o); print(time.perf_counter() - t) The nested version takes about 40x longer than the flat one (0.07 s vs 2.6 s on a release build). The fit check can stop once the line is full, which makes it cost at most the line width per level; output stays the same. Has this already been discussed elsewhere?This is a minor feature, which does not need previous discussion elsewhere Links to previous discussion of this feature:No response Linked PRsActivity
MetadataMetadataAssigneesLabelsperformancePerformance or resource usagePerformance or resource usagestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement ProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |