2 ms·
Indeed it boils down to what you need to achieve. You might want to use both approaches and combine them for best performance/readability. There are specialize
by bitL 11y ago
Indeed it boils down to what you need to achieve. You might want to use both approaches and combine them for best performance/readability.
There are specialized high-performance structures that are mutable (e.g. disruptor in HFT trading) optimizing all the way down to CPU cache lines to achieve unbelievable speeds, yet they work nicely if the objects they refer to are immutable.
So just take all advices to switch to immutability with a grain of salt and learn to figure out which approach is suitable for what part of your system to have it both performing well and being able to conceptualize and maintain the code nicely ;-)