样本:1MB的JSON文件,引入后生成500份的一个数组;

结果如下:

拷贝性能:

JSON.parse(JSON.stringify()) 的方法:2523.55517578125ms

immutable.fromJs: 1295.159912109375ms

快了一倍

 

深度比较性能:

underscore.isEqual :0.51220703125ms

immutable.is: 0.658935546875ms

不相上下,但underscore总是要快一点

 

【Immutable】拷贝与JSON.parse(JSON.stringify()),深度比较相等与underscore.isEqual(),性能比较

 

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2021-05-01
  • 2021-11-02
  • 2021-06-10
  • 2021-11-09
  • 2021-05-22
猜你喜欢
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案