Skip to content

Refactor step 2: replace Node traversal with ast.NodeVisitor#93

Closed
cgahr wants to merge 67 commits intobwhmather:masterfrom
cgahr:refactor-step-2
Closed

Refactor step 2: replace Node traversal with ast.NodeVisitor#93
cgahr wants to merge 67 commits intobwhmather:masterfrom
cgahr:refactor-step-2

Conversation

@cgahr
Copy link
Copy Markdown
Collaborator

@cgahr cgahr commented May 1, 2023

depends on #91
see #92 for discussion.

Constantin Gahr added 30 commits April 25, 2023 09:14
@cgahr cgahr force-pushed the refactor-step-2 branch from f74a38f to a1ababe Compare May 1, 2023 18:29
Copy link
Copy Markdown
Owner

@bwhmather bwhmather left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a no from me.

ast.NodeVisitor has always inexplicably awful performance. I think @jgberry benchmarked a 20% overall increase in runtime over my original @singledispatch implementation, and the current custom dispatch implementation is another 10% to 15% better than that one.

Dispatching based on name is also just less clean than dispatching based on type.

@jgberry
Copy link
Copy Markdown
Collaborator

jgberry commented May 3, 2023

Yep, see #42 for the performance related discussion. This was a decision we consciously made. Whether it was the right decision, perhaps that can be revisited. There are tradeoffs on either side.

@cgahr
Copy link
Copy Markdown
Collaborator Author

cgahr commented May 5, 2023

I see that now.

I did some performance profiling too and found similar results..

@cgahr cgahr closed this May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants