zalmoxisus/redux-devtools-extension

> Why is the autocommit option a thing? Why are actions automatically committed when they reach like 50 items?

dawgdemi opened this issue · 0 comments

Why is the autocommit option a thing? Why are actions automatically committed when they reach like 50 items?

In most of cases we need only the last changes not thousands of logs. It's intended to solve the performance problems for rendering the monitors and especially for the extension lifecycle.

Chrome doesn't allow the extension to communicate with the app's page directly (though it is declared as being for security reason, it's mostly imposed by design as the page and the extension run in different processes), that's why we relay the changes to the extension's content script, which sends them to the extension's background script, from there the extension's window can use them. This is an expensive operation especially when serializing the states. Though we made a lot of optimizations (now we mostly don't pass the full lifted state, but only the changes) it is still the bottleneck for productivity, and this object shouldn't grow infinitely.

What does the State serialization option do?

We need this only when using Immutable.js or having circular references in states. In these cases the states and action's payload objects will be serialized via jsan, so we don't lose any data by passing to the extension background script. In other cases we have plain objects and can gain some performance by disabling this option.

When we get #60 fixed, we would have more user cases for serialization, but I'm not sure we should nuke this option.

Originally posted by @zalmoxisus in #54 (comment)