Skip to content

Nest 3/4: compile hello-nest ahead of time - #8

Draft
puskuruk wants to merge 5 commits into
nest/platform-node-vendorfrom
nest/aot-hello-nest
Draft

puskuruk wants to merge 5 commits into
nest/platform-node-vendorfrom
nest/aot-hello-nest

Conversation

@puskuruk

@puskuruk puskuruk commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

apps/hello-nest (a decorated controller on NodeAdapter, @nestjs/core 12.1.3) compiles with geatsc. tools/nest/aot resolves @Module, @Controller, @Injectable and the route decorators with the TypeScript checker into a generated module function; scripts/build.mjs runs it as a compiler source-transform plugin, and reflect-metadata and the three @nestjs packages map to typed shims the generated application drives.

Needs the four compiler fixes (compiler release 1.0.38); the floor bump in package.json follows once that release exists.

  • 044a5ac Add tools/nest/aot: resolve the decorators with the checker into a generated module function
  • 23259ca Map reflect-metadata and @nestjs/common, core and platform-node to typed shims the AOT-generated application drives
  • be3c7bd Rewrite a Nest entry through the AOT resolver as a compiler source-transform plugin in build.mjs
  • cd5462c Add hello-nest on NodeAdapter with platform-node 12.1.3
  • 16bf804 Add scripts/test-hello-nest.mjs comparing the compiled hello-nest against its Node oracle over eleven requests

Verification: node scripts/test-hello-nest.mjs → HELLO_NEST_PARITY: 10 of 11 identical. The one deviation is the JSON.parse error message wording on POST /json with a malformed body (compiler item D7).

Benchmark

Same app under Node and compiled, bench/http-matrix.py (Nest 4/4), 2026-10-19, arm64 Ubuntu 24.04 container on an 8-vCPU Colima VM (Apple M1), VM otherwise idle: 2 s warmup, 8 s samples, wrk -t4 -c64, three interleaved rounds, server on vCPUs 0-3, wrk on 4-7. Not the bench host, so sizes carry the VM's variance (the same binaries moved 25-46% between two runs an hour apart); orders held in every round.

Server 1w / 1w /json 1w PSS MiB 1w startup ms 4w / 4w /json 4w PSS MiB 4w startup ms 4w p50 4w p99
nest-gea 103,000 88,705 9.4 13 210,652 194,149 10.9 15 225 µs 1.15 ms
nest-node 42,828 38,581 119.2 698 77,146 81,775 334.8 1,700 718 µs 7.72 ms
hono-gea 132,018 97,355 6.3 7 254,633 211,371 8.5 11 179 µs 880 µs
hono-node 29,372 25,538 115.7 89 56,799 48,976 260.2 148 840 µs 2.89 ms
gea-raw 156,805 153,935 4.6 14 291,858 278,909 5.9 15 154 µs 990 µs
node-raw 43,572 43,894 86.8 101 103,868 96,322 185.7 219 633 µs 2.69 ms

Four workers, GET /: compiled Nest 2.73× Nest on Node (2.40× at one worker), 2.03× bare node:http on Node, 0.83× compiled Hono; PSS 1/31; startup 13-15 ms against 698 ms and 1,700 ms. Binary 7,619,264 bytes (-Os -flto, stripped). Raw records and the full ten-server table are in Nest 4/4.

Related

Stack: #6 (1/4) → #7 (2/4) → this PR → #9 (4/4, benchmark harness and raw records). Needs the four compiler fixes geastack/compiler#7, geastack/compiler#8, geastack/compiler#9 and geastack/compiler#10 (release 1.0.38); the compiler floor bump follows that release.

@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@puskuruk
puskuruk force-pushed the nest/platform-node-vendor branch from 5d218b9 to be6383d Compare October 19, 2026 20:25
@puskuruk
puskuruk force-pushed the nest/aot-hello-nest branch from 16bf804 to 714d794 Compare October 19, 2026 20:25
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.

1 participant