Skip to content

NmeaStreamParser.ParseStreamAsync could pool its split line buffer #199

@idg10

Description

@idg10

The NmeaStreamParser.ParseStreamAsync method allocates an array (splitLineBuffer) for when an NMEA line happens to be split across a segment boundary. (We're using ReadOnlySequence<byte> to retrieve data from the stream, and its segment boundaries will tend to be determined by the underlying stream, and won't necessarily align with NMEA sentences.)

It allocates this exactly once and reuses it, so it's not going to have a large performance impact. However, we could allocate this from the array pool and return it when we are done. This would reduce the GC pressure in applications that processed a large number of individual streams.

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