OPC Studio User's Guide and Reference
OPC UA Optimizer
Client and Subscriber Development > Extensions > Integrated Extensions > OPC UA Optimizer
In This Topic

The OPC UA Optimizer improves performance of certain OPC UA operations. It is implemented as configurable plug-in on each EasyUAClient object instance. The plug-in is included and enabled by default, so that you do not have write any additional code in order to make use of its functionality.

QuickOPC also performs various optimizations on the lower level of OPC communication. The extension described here operates on higher level and only provides a specific supplementary optimization.

The optimizer can perform multiple optimizations, described below. Most optimizations work individually, but some only provide good results when combined with other optimizations.

The various optimizations performed by the OPC UA Optimizer are done on and for a specific EasyUAClient instance only. If multiple instances are used, the internal state that the optimizations may maintain is not shared. Some optimizations (such as Request Chunking, Request Merging, Parameter Restricting, and Parameter Bucketing) do not maintain state, and in this respect, the discussion is irrelevant for them. Other optimizations (such as Subscription Blending, Item Caching, or Auto-Subscribing) do maintain an internal state, and whether or not they are shared may have influence on the performance of the application. Generally, such optimizations would perform better if they have "shared" knowledge (state).

Use a common EasyUAClient instance for code that wants to allow sharing of the state used by the optimizations.

Request Merging

If an OPC operation that works on multiple items or properties is called, and some of its arguments are identical to others, the requests with identical arguments can be merged into one. For example, it makes little sense to Read the same item from the same server, with the same read parameters, multiple times in the same call. The Read can be performed just once, and the results cloned and copied over where they belong.

You may ask why somebody would write such a "dumb" code that unnecessarily performs the same thing multiple times. And indeed, in many applications, the code you are writing will by itself assures that nothing like that can ever happen. But, in other applications, the arguments to OPC operations are quite dynamic, and can be specified by the end user (and even multiple users), read from a file etc., and in such cases you lose control over what the argument values precisely will be.

The OPC UA Optimizer performs request merging for you. By default, it is enabled to be in effect on all Browse, Read, and Write operations that have identical arguments (except for the State property which may differ, because it does not influence the actual OPC operation). Call operations (OPC UA method calls) are not merged by default.

Request merging can be fully disabled as follows:

Disable OPC UA request merging
Copy Code
UAOptimizerPluginParameters optimizerPluginParameters =
    client.InstanceParameters.PluginConfigurations.Find<UAOptimizerPluginParameters>();
if (!(optimizerPluginParameters is null))
    optimizerPluginParameters.EnableRequestMerging = false;
See Also