Skip to content

Reduce the aggregator compile time #3538

Closed

Description

@jpraynaud

Why

The aggregator compiles much slower than the other nodes: its warp router is a single nested generic type of about 200 combinators and closures, and every crate that instantiates it (the library, the binary, the unit-test binary) pays for it in rustc's monomorphization collector, in dev and in release.

What

Box the filters at the 14 route module boundaries so that the router composes type-erased filters, and check that the change does not regress serving performance.

How

  • Return a BoxedFilter from the routes() function of each route module
  • Verify the compile time of the binary and unit-test targets in dev and release
  • Make sure there are no performance regression
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions