Coder Social home page Coder Social logo

Comments (5)

dedmen avatar dedmen commented on June 9, 2024

the namespace is always returned alphabetically sorted

That means backend always iterates and sorts entire thing, even if you only want a small part.
And it has to repeat for every chunk, so when you want all it repeats that a dozen times

from armadebugengine.

billw2012 avatar billw2012 commented on June 9, 2024

Well no, it would do it once when it first gets the request for actual items and cache it if you are that concerned about performance. I don't really understand why you are in this case, it currently takes 5-10 seconds to retrieve the full list anyway, this will be faster because sorting an array is very fast compared to that, and returning only 20 instead of 200000 will save massive amounts of time in serialization on both ends.

from armadebugengine.

dedmen avatar dedmen commented on June 9, 2024

and cache it if you are that concerned about performance.

But you can only cache while game is frozen
You would then in request, request how many results you want max, at what offset.
You get back the results, and the number of total entries?

from armadebugengine.

billw2012 avatar billw2012 commented on June 9, 2024

More like you just request the size for a namespace, then you request a page like { 'ns': 4, 'from': 0, 'count': 150}. This is pretty typical in this type of API where you don't know the size of the dataset, or the dataset is massive, or only parts are needed at a time.

from armadebugengine.

billw2012 avatar billw2012 commented on June 9, 2024

But you can only cache while game is frozen

Of course, I don't see the problem though.

from armadebugengine.

Related Issues (13)

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.