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 — gh-153568: Parse arithmetic with operator loops by pablogsal · Pull Request #157413 · python/cpython Conversation
|
| Codebase | Python files | Release CPU time | PGO/LTO CPU time |
|---|---|---|---|
| Standard library | 2,060 | 16.02% less | 17.91% less |
| Home Assistant | 18,731 | 17.19% less | 19.18% less |
| mypy | 442 | 16.50% less | 17.83% less |
| PyTorch | 4,890 | 14.54% less | 17.50% less |
The timings include tokenization, building the AST and cleanup, without compiling bytecode or running the files.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
1c7ff67 to
b98d899
Compare
Turn rules marked with operator_loop into a simple loop over operators and operands. Keep the cached result and the existing error rules.
b98d899 to
500def1
Compare
| candidates: dict[str, Rhs] = {} | ||
| for name, rule in marked.items(): | ||
| if rule.type != "expr_ty": | ||
| reject(name, "requires result type expr_ty") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is not tested (and several other reject branches are not tested either). Maybe add some tests for invalid grammar?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| left, operator, right = alt.items | ||
| assert isinstance(operator.item, StringLeaf) | ||
| token = self.exact_tokens[ast.literal_eval(operator.item.value)] | ||
| self.print(f"case {token}: {{") |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
No debug traces are printed (e.g. D(fprintf(...)).
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.