If you are dealing with multi threaded code then it's a classic "pick two out of three" situation regarding correctness, simplicity, and performance. Immutable data is a remarkably good starting point in this regard. Going mutable won't necessarily bring speedups since cross-thread communication is quite slow.
View all comments
0
u/koflerdavid Sep 18 '26
If you are dealing with multi threaded code then it's a classic "pick two out of three" situation regarding correctness, simplicity, and performance. Immutable data is a remarkably good starting point in this regard. Going mutable won't necessarily bring speedups since cross-thread communication is quite slow.