I am implementing a RESTful API that returns an array. I want to know if it will be more efficient to sort the array in descending order in my backend code or in the javascript?
I would actually try to hand it off to the database. Write the query where the array returned from the DB is already sorted. The most computing power and most efficient sorting is probably on the DB.
This goes to sorting, filtering in general IMO.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With