-
Notifications
You must be signed in to change notification settings - Fork 16
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
Drop heuristic to improve runtime #2
Conversation
This drops the heuristic, since using it is a net negative. Improves the runtime by ~30% on Intel Core i7-12900k.
Thanks for the PR! That's an interesting result about the heuristic. On my input it results in a 15% speedup from eliminating branches.
Would you mind checking if the speedup is from the structure of your input? I modified the code to add a simple counter:
|
Good to see those numbers. Also explains the runtime differences somewhat. I find it quite surprising that there are such differences in the inputs. This is the result I get:
So it looks like for my input the heuristic actually makes it a lot worse. Anyway, I would find it reasonable for you to optimize for your input, so feel free to close the PR. |
I'm curious what could cause such a difference. Let's leave the PR open for now until I can dig into it a little. Visualizing the path taken may provide some insight. |
4a99aac
to
d066d29
Compare
98bb73e
to
1b240a6
Compare
3a27b90
to
e3296a3
Compare
ca1bb0d
to
d7b0a50
Compare
b7add2b
to
f28f007
Compare
c30257e
to
b3bf7af
Compare
Following up nine months later... 🙂 Implemented an animation visualizing the frontier in order to debug. With your input and the heuristic set as the Manhattan distance towards the bottom Tweaked the heuristic from
|
Tweak heuristic to fix performance regression on some inputs. Thanks for flagging this! |
This drops the heuristic, since using it is a net negative. Improves the runtime by ~30% on Intel Core i7-12900k.