Skip to content

Question: can we move away from flyweight pattern? #366

@yschimke

Description

@yschimke

My contention, if we move away from the single concrete implementation of Frame, and various flyweights e.g. ErrorFrameFlyweight. We could have extremely light implementations of Frame subtypes like ErrorFrame that would just wrap a ByteBuf, which was then recycled. The cost of any particular Frame instance (ignoring the ByteBuf) is roughly equivalent to any one of the million of temporary objects we create with all the syntactic sugar that happens in reactor operations.

We don't get much from Frame being recycleable, since the main cost if the ByteBuf within.

By moving to a more idiomatic model with Frame subtypes, we would get type safety and a more discoverable API for ourselves. n.b. these are generally internal so mostly I don't think this affects a user of the ReactiveSocket API.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions