-
objective try
problem question thanks and best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The simplest thing to do is to change the for move in game.mainline_moves():
board.push(move)
move_stack = board.move_stack
variation_san = board.root().variation_san(move_stack) to this for move in game.mainline_moves():
board.push(move)
move_stack = board.move_stack
variation_san = board.root().variation_san(move_stack) In my quick tests (with relatively simple PGN files), this made reading a PGN file about 8 times faster: 128 seconds to read 1000 games before the change, 17 seconds after the change. You don't need the |
Beta Was this translation helpful? Give feedback.
The simplest thing to do is to change the
for move in game.mainline_moves():
loop fromto this
In my quick tests (with relatively simple PGN files), this made reading a PGN file about 8 times faster: 128 seconds to read 1000 games before the change, 17 seconds after the change. You don't need the
move_stack
and…