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

canopy performance improvements #2

Merged
merged 1 commit into from
Mar 22, 2015

Conversation

lefthandedgoat
Copy link
Contributor

@sergey-tihon Found that canopy was not performing as well as it could for the 2048 Dojo. Because you check to see if the game has ended on each loop, and 99% of the time its expected to not have ended, exhaustively checking all types of selectors is a waste of time. He and I talked in this ticket: lefthandedgoat/canopy#163 (comment) and decided to add hints to canopy so that you could tell canopy to opt out of the whole list of finders and only use a specific one. This helped out significantly.

I originally forked Sergey's copy of the dojo and it was taking about 10 seconds to make 15 decisions. With optimizations in place it could do 60 decisions (and plays) in 10 seconds. The increases are very obvious for the faster algorithms. The more intelligent algorithms spend more time analyzing the board, so the improvements are not as obvious. I had originally tested against @mathias-brandewinder canopy-2048 project and observed this. Hope this PR makes the dojo more fun!

Great dojo by the way!

@mathias-brandewinder
Copy link
Contributor

Thanks a lot for doing this! I need to just try it out and review, will do that ASAP. I suspect that you do know a thing or two about Canopy, so I expect this will make it in :)

@lefthandedgoat
Copy link
Contributor Author

Only concern is that it goes so fast it may cause selenium to blow up because the game/dom hasn't 'settled' yet when selenium is trying to do its thing. If that's the case I can beef up the helper functions you have written that aren't something the dojo participants wouldn't mess with anyways.

@kimsk kimsk mentioned this pull request Mar 15, 2015
@mathias-brandewinder mathias-brandewinder merged commit 87f3e7a into c4fsharp:master Mar 22, 2015
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.

2 participants