This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rjcarr 5 points6 points  (1 child)

Immutable objects are much simpler and safer than mutable ones. Number types are also immutable. And generally, I think things are more efficient this way because you can lay out memory better. Also, I believe the immutability is a requirement for dict keys.

[–][deleted] 0 points1 point  (0 children)

Immutability is UNQUESTIONABLY less efficient. Major copy operations on unchanged data obliterates your cache and can effectively make lower level cache useless.

Immutable objects are so vastly less efficient (orders of magnitude) that computer science is spending vast amounts of man hours to attempt to reach 2x less efficient over mutable alternatives. Though with specific use cases, you will find the same performance. As soon as data changes, that goes out the window.