ext4.2
需求:
清空store1的数据,并把store2的数据加载到store1中。速度太慢,需要优化。原始代码:
var start1 = new Date().getTime(); anlyGridStore.removeAll(); var start2 = new Date().getTime(); console.log(start2-start1); //614 analyses.each(function (record) { data.push(record); }); var start3 = new Date().getTime(); console.log(start3 - start2); //3 anlyGridStore.insert(0, data); var start4 = new Date().getTime(); console.log(start4 - start3); //183
改进代码:
var start1 = new Date().getTime(); anlyGridStore.loadData(analyses.data.items, false); // 227 var start4 = new Date().getTime(); console.log(start4 - start1);
ext store remove old datas load new datas优化
时间: 2024-11-18 12:45:19