其他 - Persistent and Transient Data Structures

优质
小牛编辑
121浏览
2023-12-01

As we can see in this performance test, the transient list builder was still a lot slower than the fully mutable version, but much faster than the fully immutable version. Also, if you pass the mutable array to Immutable.List or Immutable.fromJS, you’ll find the transient version closes the performance gap. The test also shows how slow Object.freeze can be compared to the other three.