Skip to content

Commit 4c503b6

Browse files
author
Maxime Chevalier-Boisvert
committed
Make the Rubykon benchmark 10x faster per iteration
To alleviate warm-up duration issues, we can shorten the per-iteration time for benchmarks where it's particularly long.
1 parent 6a6c3a3 commit 4c503b6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

benchmarks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ rack:
7272
ruby-json:
7373
desc: an optimized version of the json_pure gem's pure Ruby JSON parser.
7474
rubykon:
75-
desc: Ruby solver for Go (the boardgame.) Runs 1,000 iterations forward from an initial starting board.
75+
desc: Ruby solver for Go (the boardgame.) Runs many iterations forward from an initial starting board.
7676
tinygql:
7777
desc: TinyGQL gem parsing a large file in pure Ruby
7878
nqueens:

benchmarks/rubykon/benchmark.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
# Note: it's hard to validate correct behaviour because it's a Monte Carlo tree search. It doesn't
1010
# return the same stable best_move, even for identical initial board state and number of iterations.
1111

12-
ITERATIONS = 1000
13-
game_state_19 = Rubykon::GameState.new Rubykon::Game.new(19)
12+
ITERATIONS = 100
13+
game_state = Rubykon::GameState.new Rubykon::Game.new(19)
1414
mcts = MCTS::MCTS.new
1515

1616
run_benchmark(10) do
17-
mcts.start game_state_19, ITERATIONS
17+
mcts.start game_state, ITERATIONS
1818
end

0 commit comments

Comments
 (0)