I have implemented react/js sorting grid base on this React library
things work very nice, but I am getting slower and slower response when I have over 50k objects in in array. Over 50k takes around 4 seconds. Over 250k it takes 10 seconds.
I do not have complicated data structure, this is what I have:
var myData = [{name: "my name", description: "my description", grade: 3}]
I am using sorty for this task. Have I reached a limitation of the technology, or I am doing something wrong?
I know it cant be instant, I am just trying to increase speed as much as possible. Any insight is appreciated.
After lots of experimenting, I decided to try sorting with underscore before trying to make my own sorting function.
if (SORT_INFO.dir === -1){
var data = _.sortBy( this.state.data, SORT_INFO.name ).reverse();
} else {
var data = _.sortBy( this.state.data, SORT_INFO.name );
}
What surprised me is the speed of it. It is roughly 10 fold. 1mil object in array, takes maybe 4 second. I wonder why?