Serializing and deserializing object references is an expensive operation that causes measurable overhead especially in the self-organization case studies. While deserialization is fast (a simple array lookup that maps the object's identified to the reference), serialization is expensive, as a dictionary lookup has to be performed in order to find the object's identifier.
Unfortunately, it is in general not possible to store the identifiers within the object itself, as S# supports arbitrary classes. Nevertheless, it might be possible to support an optimization for classes compiled with the S# compiler where a field for the identifier is added to each Component-derived type during code normalization.
Additional optimization opportunities should be investigated.
Serializing and deserializing object references is an expensive operation that causes measurable overhead especially in the self-organization case studies. While deserialization is fast (a simple array lookup that maps the object's identified to the reference), serialization is expensive, as a dictionary lookup has to be performed in order to find the object's identifier.
Unfortunately, it is in general not possible to store the identifiers within the object itself, as S# supports arbitrary classes. Nevertheless, it might be possible to support an optimization for classes compiled with the S# compiler where a field for the identifier is added to each
Component-derived type during code normalization.Additional optimization opportunities should be investigated.