c# - How to minimize the memory used by array -


i trying optimize memory usage in game. lot of memory taken huge array of struct:

/// <summary> /// represents keyframe in animation track. /// </summary> public struct bonekeyframe {     /// <summary>     /// creats new bonekeyframe.     /// </summary>     /// <param name="transform">the transform keyframe.</param>     /// <param name="time">the time in ticks keyframe.</param>     public bonekeyframe(matrix transform, long time)     {         this.transform = transform;         this.time = time;     }     /// <summary>     /// transform keyframe.     /// </summary>     public readonly matrix transform;     /// <summary>     /// time keyframe.     /// </summary>     public readonly long time;  } 

i want replace transform member custom class/struct. should contain optional translation vector3, optional scale vector3 , rotation quaternion (vector4). how can design becomes compact possible... point reduce total size of bonekeyframe array.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -