Partager via


Performance considerations when using enumerable types

We’ve observed a high CPU utilization when using enumerable datatypes with binary serialization/intranode interaction. Performance degradation is most noticeable when a List (or Array) contains many items and/or the frequency of use is very high. The root cause for this is in the conversion of each item in the list to XML prior to binary serialization in our proxies. This regression will be fixed with the next update.

For now you can use the following workaround.

1. Identify each class which is itself a member of a list or array.
2. In the definition for this class, inherit from Microsoft.Dss.Core.IDssSerializable, and implement stubs for the members as shown below.

using Microsoft.Dss.Core;
...

[DataContract()]
public class MySensorState
{
[DataMember]
public List<MyListElement> MyLists;
}

[DataContract]
public class MyListElement: IDssSerializable
{

#region IDssSerializable Members

object IDssSerializable.Clone()
{
throw new Exception("The method or operation is not implemented.");
}

void IDssSerializable.CopyTo(IDssSerializable target)
{
throw new Exception("The method or operation is not implemented.");
}

object IDssSerializable.Deserialize(System.IO.BinaryReader reader)
{
throw new Exception("The method or operation is not implemented.");
}

void IDssSerializable.Serialize(System.IO.BinaryWriter writer)
{
throw new Exception("The method or operation is not implemented.");
}
#endregion

}