A recent Stack Overflow question prompted me to start a series of short posts with some basic performance tips/gotchas for

observablearray not updating-3observablearray not updating-39

mariah carey and eminem dating - Observablearray not updating

It is important, however, to understand that the with binding will re-render the entire section whenever its bound value changes.

For example, we might want to render a selected item like: changes, the contents are re-rendered completely.

The control-flow bindings are certainly handy, but when performance matters, it helps to understand a little bit about how they are implemented.

In cases where you want to avoid re-rendering entire sections of your UI, it takes a little extra work to ensure that this is not happening too frequently.

Another choice would be to use the binding in smaller, targeted areas.

We can make use of the containerless control-flow bindings to wrap more specific sets of elements, as shown here.

However, one important thing to note is that currently computed observables will always notify subscribers when re-evaluated, even if their value ends up being the same. Notifications are suppressed when you write a value that is identical to the previous value (this behavior can be overridden).

So, one option is to subscribe to changes to our observable Array and populate an observable based on the length.

The control flow bindings introduced in Knockout 2.0 are really just simple wrappers to the template binding.