Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible performance antipattern in formmanipulation #3560

Open
wence- opened this issue May 10, 2024 · 1 comment
Open

Possible performance antipattern in formmanipulation #3560

wence- opened this issue May 10, 2024 · 1 comment

Comments

@wence-
Copy link
Contributor

wence- commented May 10, 2024

Describe the current issue

I happened to be looking at this code I wrote years ago and noticed:

return self.expr(o, *map_expr_dags(self.index_inliner, operands))

This is the traversal antipattern discussed in FEniCS/ufl#35

In lieu of a proper fix in UFL to the visitor infrastructure, I think this could be addressed by passing in a cache as the optional argument to map_expr_dags (as seen in FEniCS/ufl#69)

@wence-
Copy link
Contributor Author

wence- commented May 13, 2024

I think the IndexInliner object could be removed and the handler for Indexed promoted to the ExtractSubBlock multifunction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant