Skip to content

Consider adding lightweight payload length read to NmeaLineParser #198

Description

@idg10

Currently when dealing with fragmented messages we end up constructing an NmeaLineParser twice for each fragment. We do it once in the loop where we calculate the total size of the message and then again when we come to combine the individual payloads.

This does more work than necessary. A lightweight method that just reports the length of the payload without doing everything else that the NmeaLineParser constructor does would make this more efficient. (Since we'd be skipping the full validation in this initial step, it would need to do a basic sense check: it should check that the reported payload isn't longer than the whole message. But since we do eventually run the NmeaLineParser for each fragment, that should be enough.)

This is probably going to be of marginal value because the overwhelming majority of messages are not fragmented, but it's not nothing.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions