Skip to content

🧹 [Maintenance]: Refactor DefaultReq and DefaultRes fields #3632

@grivera64

Description

@grivera64

Maintenance Task Description

In #3533, we refactored DefaultCtx into *DefaultReq and DefaultRes. For methods that require both request and response, we use a c Ctx field to access the other methods as necessary. After this change, the benchmarks (e.g. AutoFormat) seem to report one more allocation than normal (see #3533 (comment)).

Per discussion with @ReneWerner87 on the Fiber discord, this issue suggests to update the DefaultReq and DefaultRes structs to use c *DefaultCtx to guarantee that no new allocations are made.

Impact on the Project

By addressing this issue, we can achieve our original allocation count in v2 and meet our "zero memory allocation" goal.

Additional Context (optional)

No response

Checklist:

  • I have confirmed that this maintenance task is currently not being addressed.
  • I understand that this task will be evaluated by the maintainers and prioritized accordingly.
  • I am available to provide further information if needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions