GithubHelp home page GithubHelp logo

Comments (4)

pkacprzak avatar pkacprzak commented on May 20, 2024 1

Definitely good ideas - thank you. I think I can do chained /standard requests to construct some prefix of the mainline so that no change in the API is needed. The first 3-5 moves should be enough for any reasonable use-case I think.

from lila-tablebase.

niklasf avatar niklasf commented on May 20, 2024

The rate limiting on this endpoint is quite strict (currently one request per minute with bursts of 5), because computing the mainline is fairly expensive. It needs to hit the tablebase for (just about) every legal move at every step, which can mean hundreds or thousands of probes.

To clarify, do you need the entire line, or just the best move?

from lila-tablebase.

pkacprzak avatar pkacprzak commented on May 20, 2024

Thanks for the clarification.

The first couple of moves would be best, but I'm doing a workaround now:

  1. If I don't get rate limited, then I'm giving the full line
  2. If I get rate limited, I give the line as only the best move from the response from /standard endpoint

I'm planning to push the update soon so I can monitor how is it doing.

from lila-tablebase.

niklasf avatar niklasf commented on May 20, 2024

Sounds good. Another idea would be adding a new parameter like ?limit=5 for /standard/mainline (and I will, if you would use that), but the rate limiting is done outside of this server (by nginx), so it can't really take that into account.

Alternatively, how about always just doing sth like 5 /standard requests in sequence? It's a little bit of HTTP overhead, but avoids the expensive full mainline probes and works with the existing limits.

from lila-tablebase.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.