Reputation: 512
I develop a web app with Javascript + React and a REST API in Java as backend. The frontend receives from backend via REST a list of objects which look like this:
{
"id": "11111",
"operationDate": "2020-02-21 00:00:00",
"status": "A"
...
}
Those objects are grouped by id (which is not unique in this case) and then sorted (within a group) by date. It's already done in JavaScript, but I wonder if I should move grouping and sorting to Java and send it via REST already grouped and sorted for the sake of performance. It will require some work so I'd like to know if it's worthwhile.
Upvotes: 0
Views: 192
Reputation: 512
Answering my own question: I measured the time of the grouping and sorting for a set of 12k+ objects and it appears it took only 16 miliseconds. Considering the amount of work necessary to move it to backend and fact that incoming lists will hardly ever be larger it's not worth it.
Upvotes: 1