I have a JSON file that contain more than 40K (40000) lines.
I used this code to get the data of json and put the received data in variable:
this.http.get(url).map(res => res.json()).subscribe(data => {
...
this.users=data.users;
...
this.images=data.images;
this.removeDupicates();
...
});
My problem: when the data of JSON is loaded and try to put the data in variable and try to remove the duplicates, the application take long time to be ready.
So is there any solutions that speed up this process or fix it ?
EDIT:
Here is the code of function "removeDuplicates"
removeDupicates(){
for(let i=0; i<this.images.length; i++){
for(let j=0; j<this.images.length; j++){
if(this.images[i].img == this.images[j].img && i!=j){
this.images.splice(i,1);
}
}
}
}