Why Immutable is good for js?

In the present. time, everywhere it is told about T. N. immutability and how it's great/cool/ipoopdaily, as the advantages are such arguments as:
Greater scope for optimization by the compiler
Simplifying the life of tools for static code analysis
Simplification tracking changes to data structures
To avoid many tn side effects in functions
( one of the DOS. pros)Nonblocking read from different threads, etc.

But:
In JS, only one thread of execution.
Side-effects!? Do they really fully solved using immutable data..?
Individual uncertainty arises about "optimizing compiler": surely some purely artificial idea, alien to the language in question, can contribute to some kind of optimization?
And all this would be more or less tolerated, if these really were immutable, but, indirectly, they are subject to change( speaking of setIn in immutable).

Which raises one big question: why invent unnatural for JS hemorrhoids as immutable data to drag into the project just for this single fat file to.. still have to change the data, but instead of economical changes made to one element each time to copy the whole array.. with only one changed element( or even one of its fields), and, it would seem, and then the savings of memory and computing power percent ?
What immutability in JS is so good that justifies such heavy overheads with a rather vague positive terms?
July 8th 19 at 12:18
3 answers
July 8th 19 at 12:20
All right. A bunch of react+redux+immutable.js not widely used due to performance (performance of it is low), but because it is well suited for team development because of its consistency and clear regulation, well, the authority of the Creator (gaearon) plays a role.

View to the side https://github.com/mobxjs/mobx - the authors of this library have asked the same questions and did a great thing.
That's just this bundle of worries and react, on the one hand, it is itself a good, and on the other a strong desire to not do something so difficult and greedy in terms of resources that will blunt already with multiple open tabs( but, "as I told: immutability - because most peysateley of Wikipedia can't be wrong and it is fast and cool.. just because.. + tons of any unknown libraries - about, for the same reason"), and beautiful, powerful and nimble.

PS: if there are links to how to improve( including speed) this bundle( or something similar with REAKTOR) - I read with interest. - Jerod_Wintheiser commented on July 8th 19 at 12:23
if the question is about libraries, here's today's article on Habre https://habrahabr.ru/post/304000/. Tried this hack, it is really kind of a lot fast. There in comments there is a link to the benchmark.

If you need to accelerate it React, then there remains only debit - find out what and why you rerendered when the state changes, twilite shouldComponentUpdate. For redux also has its techniques (for example, https://github.com/reactjs/reselect), but I have not tried - alberta31 commented on July 8th 19 at 12:26
July 8th 19 at 12:22
I thought the main advantage is not this, but that it is possible to track the changes of object
Liked the report on this subject https://www.youtube.com/watch?v=8BExyeds_c0
July 8th 19 at 12:24
You even listed all the reasons. Here then necessary. Whether or not you believe the developers of compilers that their compilers will run faster with immutable data?

If you personally do not - do not use, no big deal :)
Very informative.
What exactly? Why exactly is necessary?

We are not in the Church to believe the word just "because".
The figures from the developers..
Very interesting how they make a compiler for.. JS, but still one in which direct modification of modifiable( Yes, that's right) the data will be slower than the same thing, but with spike layer for the ... not change, but in the end, it is still to change( of course, first creating a complete duplicate copy of) data, like, must remain immutable.

And, Yes, if you can not answer in fact - better to just not respond. - Jerod_Wintheiser commented on July 8th 19 at 12:27

Find more questions by tags React