i am writing a wrapper around an API which takes in a couple of inputs and supplies nested JSON data.
Before showing it on UI, i have to order that data by a certain property "Price" which is a decimal (from high to low).
I am trying to understand
- What is the most performant way of dealing with this ordering. My UI consumes the same JSON object that comes from the API.
So if i am to order the data from High "Price" to Low
a. do i convert the API output to a strongly-typed list of "Item" objects, b. perform an ordering on the "Price" property c. then convert the list of "Items" back to JSON so that UI can use it.
This just seems to be an overkill to retain this in-memory representation of JSON to perform ordering.
- If i have a large set of data, how do i stop running out of memory. Again this ties into the answer/solution that will be used in Question 1.
How do i approach this
thanks for your help