I have 50000 rows and 200 columns(on each row) and trying to delete all col objects from each row object, now it's taking 5 seconds to complete entire process. Is there any better way to improve performance? Note : There is chance of skip some objects, in this case don't delete skipRows and skipCols objects.
var skipRows = {10:1,11:1,12:1,13:1,14:1,15:1,16:1,17:1,18:1,19:1,20:1};
var skipCols = {50:1,51:1,52:1,53:1,54:1,55:1,56:1,57:1,58:1,59:1,60:1};
for(var i = 0; i < 50000; i++){
if(!(i in skipRows)){
var rowObject = rowColObjects[i];
for ( var j = 0; j < 200; j++){
if(!(j in skipCols)){
delete rowObject[i+"-"+j];
}
}
}
}
below is the fiddle to see sample code and results :
http://jsfiddle.net/rambabu14/9mcne3en/
Thanks, Rambabu.
rowColObjects=[]should work just fine.rowColObjects={}?50000elements of the object.