dontRepeatMessages Context

The dontrepeatmessages context does an exception safe extending of the optimization of the removal of duplicate reference change messages across multiple notifications.

with dontRepeatMessages <boolean> <expression>

When the 'removal of duplicate reference change messages' optimization is enabled (see preferences.dontRepeatRefMsg ), during a single reference change notification duplicate messages sent to the same objects are removed. Within a dontrepeatmessages context, that optimization applies across all reference change notifications within that context. So, for example:

with dontrepeatmessages on with animate on for t = 1 to 100 do at time t $.radius = t/2

The notifications that are sent to the dependents of the selected node $ when the first value is set are not sent for the remainder of the value set operations. This can result in significant performance benefits in some cases. For example running:

s = sphere isSelected:true
(t1=timestamp();with dontrepeatmessages off with animate on for t = 1 to 10000 do at time t s.radius = t/2;timestamp()-t1)

shows that setting all of the values with the context off took 226 milliseconds, while running:

s = sphere isSelected:true
(t1=timestamp();with dontrepeatmessages on with animate on for t = 1 to 10000 do at time t s.radius = t/2;timestamp()-t1)

shows that setting all of the values with the context on took 175 milliseconds.

See the related setting

preferences.dontRepeatRefMsg

.