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

Make the Rubykon benchmark 10x faster per iteration #335

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ rack:
ruby-json:
desc: an optimized version of the json_pure gem's pure Ruby JSON parser.
rubykon:
desc: Ruby solver for Go (the boardgame.) Runs 1,000 iterations forward from an initial starting board.
desc: Ruby solver for Go (the boardgame.) Runs many iterations forward from an initial starting board.
tinygql:
desc: TinyGQL gem parsing a large file in pure Ruby
nqueens:
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/rubykon/benchmark.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
# Note: it's hard to validate correct behaviour because it's a Monte Carlo tree search. It doesn't
# return the same stable best_move, even for identical initial board state and number of iterations.

ITERATIONS = 1000
game_state_19 = Rubykon::GameState.new Rubykon::Game.new(19)
ITERATIONS = 100
game_state = Rubykon::GameState.new Rubykon::Game.new(19)
mcts = MCTS::MCTS.new

run_benchmark(10) do
mcts.start game_state_19, ITERATIONS
mcts.start game_state, ITERATIONS
end
Loading