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 parser by caching normalized identifiers? · Issue #148931 · python/cpython Closed Labels interpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-parsertype-featureA feature request or enhancementA feature request or enhancement DescriptionFeature or enhancementProposal:import ast body = '섀' + 'S' * 8000000 # non ASCII! ast.literal_eval('Y(' + body + ')' ) # pretty fast ast.literal_eval('Y(' + body + '=!') # noticably slower due to re-normalization After some profiling, it is pretty clear that we are normalising the identifier many times:
Instead of normalising every time in Lines 502 to 533 in 448d7b9
Maybe we could cache it in the This was found by OSS-Fuzz 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 Activity
MetadataMetadataAssigneesLabelsinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)performancePerformance or resource usagePerformance or resource usagetopic-parsertype-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. |