amazon-ion / ion-element-kotlin

IonElement is an immutable in-memory representation of the Ion data format. IonElement's API is idiomatic to Kotlin.
Apache License 2.0
8 stars 7 forks source link

Consider adding a `StructElement` implementation that is optimized for simple cases #89

Open popematt opened 7 months ago

popematt commented 7 months ago

StructElementImpl must consider the possibility of multiple fields with the same name. However, we could create a specialized variant for the (common) case of having no duplicate field names. By assuming that there are no duplicate field names, we can make optimizations that will reduce the memory footprint of the struct and the computation needed for operations such as equals().