Skip to content

Per-request CPU waste: env copy, template re-read, double route match #243

Closed

Description

@jrosskopf

Found during the DuckDB 2.0 upgrade (#241), measured with a heap/CPU profile under load:

  • SQLTemplateProcessor::getEnvironmentVariables copies the process environment on every request
  • loadTemplateContent re-reads the SQL template file from disk on every request
  • RouteTranslator::matchAndExtractParams runs twice per request (auth middleware and rate-limit middleware)

Each is small, together they add CPU per request on hot endpoints.

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