Skip to content

Improve serialization perfromance in .Net 6+ apps #14

@mrf460

Description

@mrf460

I think we should look into implementing System.Text.Json source generation in Hydra. It should improve serialization and startup performance in .NET 6+ apps (more info here).

It will require some refactoring, since we will have to add multi-platform targeting and use new 6-specific APIs; I'd rather not target 6+ exclusively.

We will also have to figure out how to allow users to optionally define their own JsonSerializerContext and pass it to Hydra if they care to. This is due to the fact that we won't know their bdy classes at serialization time beforehand. Doing this with a clean API will be a bit of a challenge, but there are examples we can look at for inspiration (eg Asp Core's AddControllers has a mechanism that looks nice).

This should only really matter for high-performance scenarios, but it is still worth looking into IMO

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