Skip to content

perf: sync routes with path parameters cannot use try_rsgi_sync_short_circuit #254

Closed

Description

@ZhuchkaTriplesix

Where: src/lib.rs:487-494 (trivial_sync check) and src/dispatch.rs:454 (route_is_trivial_sync).

Currently, trivial_sync requires handler_param_names.is_empty().
This means any sync route taking path parameters (e.g. @app.get("/items/:id") def get_item(id: int)) has trivial_sync = false and is forced onto the full async pipeline (future_into_py, Tokio worker dispatch, asyncio Future allocation, GIL acquire/release cycles).

Fix direction:
Extend the sync short-circuit path to support synchronous routes that have path parameters (and no async dependencies, no request body reading, and no rate limiting). Pass the extracted path parameters to the sync handler inline.

Activity

  1. added
    enhancement
    on Oct 18, 2026
  2. added a commit that references this issue on Oct 18, 2026
  3. ZhuchkaTriplesix commented on Oct 18, 2026

    @ZhuchkaTriplesix
    MemberAuthor

    Resolved in PR #261

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions