Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

What benefits(if any) does the StandardPages object have over an array?

Asked by 6 years ago

So I was reading up on the GetGamePlacesAsync function of AssetService and I noticed that it returns the StandardPages object. It's not my first time seeing it, but it made me wonder: why not just use a multidimensional array? Does using StandardPages have any benefits over an array?

1 answer

Log in to vote
1
Answered by
XAXA 1569 Moderation Voter
6 years ago
Edited 6 years ago

A game can have a boundlessly large number of places associated with it. Having GetGamePlacesAsync retrieve all the places associated with the game with one call as an array just doesn't scale too well (e.g. a game that has a million places will return a table with a million entries.) That's a dangerous waste of bandwidth and memory.

A good analogy would be video streaming. With video streaming, you can watch the video as more pixels (for a lack of a better term) are loaded, instead of having to wait for the entire video to download. Likewise, with pages, you can read each page as you go without having to load the entire table in one sitting.

0
Ah, now I see. Thanks! antonio6643 426 — 6y
Ad

Answer this question