Passing huge array into child Table dynamically

I am parsing pdf in server side and get data list in list with a huge list. When I passed that huge array in child table dynamically then browser slow down. I also parse pdf with small list and its will dynamically add records in child table.


process_pdf:function(frm){
cur_frm.clear_table(“selling_product”);
cur_frm.refresh_fields();
let pdf_file = frm.doc.file;
if(frm.doc.city){
let dist_city = frm.doc.city;
frappe.call({
method: “erpnext.distributor.doctype.brick_wise_sale.brick_wise_sale.parse_pdf”,
args: {
‘pdf_file’: pdf_file,
‘dist_city’: dist_city,
},
callback: function ® {
var info = r.message;
//get pdf length
console.log(info)
// frappe.show_progress(__(‘Loading’),50,100,‘Please Wait until the data load’)

				// var time = 2000;
				var len = info.length;
				// i = 0,j = array.length; i < j; i += chunk
				for (index = 0; index < len; index++) {
					let element = info[index];
					var child = cur_frm.add_child("selling_product");
				// console.log(element)
				// if(element[0]=='PRODUCT NAME PACK'){
					// if(index%50 == 0){
					// 	time = time + 1000
					// }
					// console.log(time)
					for (let j = 0; j < element.length; j++) {
						let nested_element = element[j];
						// console.log(element[j])
						// setTimeout((j)=>{
						switch (j) {
							case 0:
								frappe.model.set_value(child.doctype, child.name, "product", nested_element)
								break;
							case 1:
								frappe.model.set_value(child.doctype, child.name, "product_name", nested_element);
								break;
							case 2:
								frappe.model.set_value(child.doctype, child.name, "brick", nested_element);
								break;	
							case 3:
								if (nested_element.includes(',')){
									frappe.model.set_value(child.doctype, child.name, "sale_qty", parseInt(nested_element.replace(/,/g, '')))
								}else{
								frappe.model.set_value(child.doctype, child.name, "sale_qty", parseInt(nested_element))	
								}break;
							case 4:
								frappe.model.set_value(child.doctype, child.name, "brick_parent", nested_element)
								break;
							case 5:
								// console.log(parseInt(nested_element))
								frappe.model.set_value(child.doctype, child.name, "product_price",parseFloat(nested_element))
								if(child.product_price && child.sale_qty){
									frappe.model.set_value(child.doctype, child.name, "value",child.sale_qty*child.product_price)	
								}
								break;	
							default:
								break;
						}
					// }, time)
						cur_frm.refresh_field("selling_product")
					}

When I have array greater than 1000 then it will slow down my browser.