Skip to content

[Variant] Use row-oriented builders in cast_to_variant #8310

@scovich

Description

@scovich

Is your feature request related to a problem or challenge? Please describe what you are trying to do.

While reviewing other code, I noticed that cast_to_variant uses an inefficient column-oriented approach to building variant values. For primitive types this works ok, but for deeply nested types it means repeatedly creating new variants (and variant metadata), only to re-code them by copying the variant values to new arrays (with new metadata and field ids). Very expensive.

Describe the solution you'd like

Use a row-oriented builder approach, similar to what variant_get uses.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementAny new improvement worthy of a entry in the changelog

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions