You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the construction model, each element stores its location in the source file in an ElementLocation instance.
There are two implementations of this abstract base class: SmallElementLocation and RegularElementLocation, storing line/column data using ushort and int respectively.
The rationale here is that most values are small (< 0xFFF) and so using different storage sizes in different cases can reduce memory footprint.
However, the CLR will align the fields of this class to four-byte boundaries on most architectures for performance reasons. Therefore the optimisation in SmallElementLocation is unlikely to have any effect.
In the construction model, each element stores its location in the source file in an
ElementLocation
instance.There are two implementations of this abstract base class:
SmallElementLocation
andRegularElementLocation
, storing line/column data usingushort
andint
respectively.The rationale here is that most values are small (< 0xFFF) and so using different storage sizes in different cases can reduce memory footprint.
However, the CLR will align the fields of this class to four-byte boundaries on most architectures for performance reasons. Therefore the optimisation in
SmallElementLocation
is unlikely to have any effect.The padding/alignment can be verified here.
The text was updated successfully, but these errors were encountered: