Skip to content

Optimize generated strings for error results #242

@Whiteknight

Description

@Whiteknight

Result and PartialResult errors include a string describing the nature of the failure. Sometimes these strings are constants, but in other cases these strings are generated and therefore require allocation.

A compounding problem is that errors are often not read. Or, an inner-most error message might be discarded by failures in later parsers.

To avoid allocating custom strings which are not read or used, I suggest some kind of a lazy mechanism for generating strings only at the time they are used, such as a delegate callback wrapped in some kind of object with valuetuple parameters. It would be a little bit more expensive to read the string, but we hope that most of these strings are not being read.

Metadata

Metadata

Assignees

No one assigned

    Labels

    exploratoryWe might do it, pending investigationoptimizationSomething needs to be faster

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions