Skip to content

turnloop-mysql: Row::parse validates by cloning and iterating the row fully, so every row is decoded twice #66

Description

@proggeramlug

Problem

Row::parse validates a row by cloning it and iterating the clone fully, and then the host iterates the row again to actually consume the values. Every row is decoded twice.

Why it matters

For any workload with a non-trivial number of rows or wide rows, this is a flat 2x decode cost paid on every single result set, purely from the validation strategy Row::parse chose. Perry's P7 lane (turnloop-mysql, for mysql2) flagged this while building the row-materialization path.

What would fix it

A validating iterator that can be consumed once — validate-as-you-go rather than validate-then-iterate-again — would remove the duplicated decode work without changing the crate's safety guarantees.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions