-
Notifications
You must be signed in to change notification settings - Fork 12
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
Replace Cases with enum Tag and switch statements #99
base: master
Are you sure you want to change the base?
Conversation
Welp, the tests fail, so I probably made a mistake in refactoring one of these things. I'll ping when this passes the tests. |
Cool, the tests run now. |
@AZWN we can look at this together tomorrow if you like |
Looks good, and sounds like a plan! Tomorrow after lunch? |
Works for me. If you can find the time, please run a benchmark / profiling example beforehand so we can evaluate the performance implications as well as the code changes. |
So the good news is I was able to fairly easily change to using switch for |
I had a look at the
Cases
pattern in thestatix.solver
project and tried replacing it with switch statements. This seems to work out alright, doesn't gives much more ugly code (some cases I'd argue the code even gets better), and should be somewhat faster I think. Can you try running your benchmark/profiling example on this version and see if it makes a difference in performance? This doesn't get rid of all the lambdas, but it should help I think/hope.