ConardLi.github.io
ConardLi.github.io copied to clipboard
while循环效率问题
我对clone4的DEMO文件涉及到的WHILE循环的效率表示质疑,本地测试到的结果(node环境):
clone1 在前,clone2在后, 结果:
undefined: 0.167ms
undefined: 0.126ms
将 clone1 跟 clone2 调下位置,即clone2放在前面,结果:
undefined: 0.254ms
undefined: 0.081ms
即所消耗的时间跟调用的先后顺序有关,而不是WHILE循环的优化结果,不知你怎么看?
我对clone4的DEMO文件涉及到的WHILE循环的效率表示质疑,本地测试到的结果(node环境):
clone1 在前,clone2在后, 结果:
undefined: 0.167ms undefined: 0.126ms
将 clone1 跟 clone2 调下位置,即clone2放在前面,结果:
undefined: 0.254ms undefined: 0.081ms
即所消耗的时间跟调用的先后顺序有关,而不是WHILE循环的优化结果,不知你怎么看?
https://blog.csdn.net/haochuan9421/article/details/81414532