请教关于setData执行时间问题?

发布于 8 年前作者 lei5514765 次浏览最后编辑 8 年前来自 ask

问题是这样的,相同的数据结构setData,在两个文件里面执行效率不一样,请问具体原因是什么?

具体输出是这样的

文件一执行用时2秒,造成在前端渲染的时候,有很明显的延时

(3) [{…}, {…}, {…}]

file1.js? [sm]:437 Sat Mar 07 2020 21:33:54 GMT+0800 (中国标准时间)

file1.js? [sm]:438 {swiperList: Array(3), greenNum: 1, redNum: 0}

file1.js? [sm]:629 autoplay

file1.js? [sm]:450 Sat Mar 07 2020 21:33:56 GMT+0800 (中国标准时间)

file1.js? [sm]:636 pageChange

文件二用时如下:

(3) [{…}, {…}, {…}]

file2.js? [sm]:460 Sat Mar 07 2020 21:35:47 GMT+0800 (中国标准时间)

file2.js? [sm]:461 {swiperList: Array(3), greenNum: 2, redNum: 0}

file2.js? [sm]:660 autoplay

file2.js? [sm]:474 Sat Mar 07 2020 21:35:47 GMT+0800 (中国标准时间)

file2.js? [sm]:667 pageChange

0 回复
暂无回复