Skip to content

Commit

Permalink
benchmark for serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
lacker committed Jun 25, 2018
1 parent 9ab59a1 commit b31e3d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions game/game_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -910,3 +910,14 @@ func BenchmarkPlayout(b *testing.B) {
PlayGame(game, &RandomBot{}, &RandomBot{}, false)
}
}

func BenchmarkGameSerialization(b *testing.B) {
game := NewGame(Stompy(), Stompy())
PlayGame(game, &RandomBot{}, &RandomBot{}, false)
b.ResetTimer()

for i := 0; i < b.N; i++ {
s := string(game.Serialize())
DeserializeGame([]byte(s))
}
}

0 comments on commit b31e3d3

Please sign in to comment.