dedmen / ArmaDebugEngine

A still experimental Script Debugger for Arma 3
Other
48 stars 10 forks source link

Request: missionNamespace in chunks #11

Open billw2012 opened 4 years ago

billw2012 commented 4 years ago

This can be massive, even just getting the name list takes a few seconds on a small new game (I didn't try on a large in progress one yet!). I suggest:

dedmen commented 4 years ago

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

billw2012 commented 4 years ago

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.

dedmen commented 4 years ago

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?

billw2012 commented 4 years ago

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.

billw2012 commented 4 years ago

But you can only cache while game is frozen

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