iceberg-rust icon indicating copy to clipboard operation
iceberg-rust copied to clipboard

Avoid clone in TableMetadata Serialization

Open odysa opened this issue 1 year ago • 1 comments

When we serialize the TableMetadata, we convert it into type TableMetadataEnum. Since fn serialize takes &self and fn from(value) takes the ownership, we must do a clone.

I am unsure how it affects the performance, but it may be a concern. Ideally, we may directly serialize it into metadata V1/V2 to avoid the copy conversion.

odysa avatar Feb 03 '24 05:02 odysa

I agree that this may be a little wasteful, but the cost maybe small: the heavy ones are hold by Arc. We can do this optimization when necessary.

liurenjie1024 avatar Feb 04 '24 07:02 liurenjie1024