Skip to content

perf(worker): cache request runtime - #205

Merged
07prajwal2000 merged 1 commit into
Fluxify-rest:mainfrom
07prajwal2000:perf/compiled-runtime-cache
Aug 5, 2026
Merged

perf(worker): cache request runtime#205
07prajwal2000 merged 1 commit into
Fluxify-rest:mainfrom
07prajwal2000:perf/compiled-runtime-cache

Conversation

@07prajwal2000

Copy link
Copy Markdown
Collaborator

Summary

  • Compile route validators once at artifact load (compiledRuntime.ts), cached on CompiledRoute; request path resolves them from cache instead of re-parsing the schema up to 3x per request.
  • HttpClient now shares one module-level Axios instance instead of a new Axios() per request; removed native() escape hatch (also stripped from the two JS-editor global typings that exposed it to user code).
  • dayjs.extend(dayjsUtc) runs once at module load instead of per request; header lookups normalize into a Map once per request instead of scanning all headers per getHeader() call.
  • Compiled supervisor no longer calls initializeRedis()/initializePubSub() — no compiled request path reads Redis; shutdown uses closeNats() instead of closePubSub().

Closes #192.

Test plan

  • bun test apps/server/src/modules/requestRouter/tests/dispatch.spec.ts packages/lib/tests/parser.spec.ts — 9 pass, new test asserts the same httpClient instance is reused across two executeRouteInternal calls and header lookup is case-insensitive.
  • bun run --cwd apps/server lint / bun run --cwd packages/lib lint — clean.

@07prajwal2000
07prajwal2000 added this pull request to the merge queue Aug 5, 2026
Merged via the queue into Fluxify-rest:main with commit fb81e2d Aug 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

P1: hot path rebuilds validators and clients on every request

1 participant