Closed JamesCarr1 closed 1 year ago
Running the conversion 10000 times each yields the following results:
fen_method took 0.3049468994140625 seconds to execute 10000 times.
dict_method took 0.14049696922302246 seconds to execute 10000 times.
my_bb_method took 0.09064698219299316 seconds to execute 10000 times.
ex_bitboard_method took 0.12563681602478027 seconds to execute 10000 times.
Clearly my_bb_method
is the best.
Now further improving the efficiency of my_bb_method
. Previously, was defining the lists pieces and colours INSIDE the function. Now comparing two options:
Ever so slightly slower passing them in rather than using variables.py:
my_bitboard_method took 0.08989787101745605 seconds to execute 10000 times.
variables.py
:my_bitboard_method took 0.08812713623046875 seconds to execute 10000 times.
my_bitboard_method took 0.09048104286193848 seconds to execute 10000 times.
Therefore, use variables.py
Currently, conversion from Board object to a tensor (through as_tensor) is very slow. Compare two options: