Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Improve the performance of the RAV reader #135

Open
programarivm opened this issue Nov 3, 2023 · 0 comments
Open

Improve the performance of the RAV reader #135

programarivm opened this issue Nov 3, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@programarivm
Copy link
Member

programarivm commented Nov 3, 2023

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant