chess-api icon indicating copy to clipboard operation
chess-api copied to clipboard

Improve the performance of the RAV reader

Open jbassagana opened this issue 2 years ago • 0 comments

The getFen() method in Chess\Play\RavPlay can be quite slow if a movetext contains a significant amount of chess moves across multiple variations.

See:

Thus, the POST /play/rav API endpoint is slow because it is currently using the getFen() method to calculate the FEN positions. The example below takes a few seconds to calculate about 200 FEN positions.

output_trimmed_enhanced_reduced

At this moment two API queries are being used.

  • GET /annotations/games
  • POST /play/rav

The performance of the RAV reader can be improved by removing the POST /play/rav call from the user interface on the one hand. Then, the information for the RAV reader including the FEN positions can be precalculated and added to data/annotations/games.json.

This way one API query would be used:

  • GET /annotations/games

Happy learning and coding!

jbassagana avatar Nov 03 '23 20:11 jbassagana