Skip to content

[pigeon] Consider not sending null class fields #105233

@stuartmorgan-g

Description

@stuartmorgan-g

Currently the native code generators for data class serialization always write all of their fields, even when null. This seems wasteful, since it means we're encoding and decoding string values and null values, and then sending them across the channel, rather than just omitting them. It looks like currently the Dart code is just doing lookups and checking against null, so currently I don't think there would be a behavioral difference if we omitted them instead.

If we change this we should change it across all generators, just to make sure we don't accidentally include subtle behavioral differences that could confuse us later.

@gaaclarke Is there a reason it was written this way? I don't see any reason to send explicit nulls, but I could certainly be missing something.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions