A JavaScript monorepo stops being pleasant the day CI starts rebuilding every package for a one-line change in one app. At that point you need a task runner that knows the dependency graph, caches outputs and skips what did not change, and the shortlist is almost always Turborepo or Nx.
So we put both on the same pnpm workspace on November 30, 2026: four TypeScript packages, 608 source files, Turborepo 2.11.13 against Nx 24.1.0. Turborepo finished a cold build in 2.42 seconds to Nx's 3.39, replayed a full cache hit in 0.14 seconds to Nx's 0.60, and added 2 packages to node_modules where Nx added 91. Nx's own benchmark on a 26,000-component repo shows the opposite, and both are right: the answer depends on repo size and how much structure you want enforced.
How Turborepo Decides What to Run
Turborepo is a task runner that sits on top of your package manager's workspaces. It reads package.json scripts, builds a graph from the dependencies between workspace packages, hashes each task's inputs, and either runs the script or replays the cached outputs and logs. It does not generate code or own your project structure. Vercel maintains it, and the core is written in Rust.
The whole configuration for our workspace was 7 lines of turbo.json:
JSON{ "$schema": "https://turborepo.dev/schema.json", "tasks": { "build": { "dependsOn": ["^build"], "outputs": ["dist/**"] }, "test": { "dependsOn": ["build"] } } }
^build means "build my workspace dependencies first" and outputs tells Turborepo what to cache. That is the whole mental model.
Turborepo 2.11.13 shipped on November 18, 2026, is MIT licensed, and had 31,407 GitHub stars and 44.3 million npm downloads in the week of November 23-29, 2026.

How Nx Decides What to Run
Nx builds a project graph too, but it treats that graph as a first-class object it keeps in memory. A background process, the Nx daemon, watches the file system and keeps the graph and file hashes warm between commands. On top of the task runner Nx adds plugins that infer tasks from your existing tool configs, code generators, a module boundary lint rule and its paid CI service, Nx Cloud. The core is TypeScript with performance-sensitive parts in Rust, shipped as a native binary per platform (@nx/nx-darwin-arm64 on our Mac).
In its package-based mode Nx reads the same package.json scripts, so the config was 8 lines:
JSON{ "$schema": "./node_modules/nx/schemas/nx-schema.json", "targetDefaults": { "build": { "dependsOn": ["^build"], "outputs": ["{projectRoot}/dist"], "cache": true }, "test": { "dependsOn": ["build"], "cache": true } }, "defaultBase": "main" }
Nx 24.1.0 shipped on November 26, 2026, is MIT licensed, and had 29,497 GitHub stars and 14.7 million npm downloads in the same week.

The Benchmark: One Workspace, Both Tools
The workspace is a fake US storefront: packages/utils (tax helpers), packages/ui (depends on utils), apps/web (depends on both) and apps/api (depends on utils), each with 150 small TypeScript modules built by tsc 5.9.3. Each tool got its own identical copy.
The machine was an Apple M3 Pro running macOS with native arm64 Node.js 26.12.0 and pnpm 10.10.0. Every scenario ran three times and we report the median. Nx ran with NX_DAEMON=false, which is how Nx runs in CI by default according to its daemon docs, and its cache was pinned to the repo with NX_CACHE_DIRECTORY (more on why below). Telemetry was off for both.
| Scenario | Turborepo 2.11.13 | Nx 24.1.0 |
|---|---|---|
| Cold build, empty cache (4 tasks) | 2.42 s | 3.39 s |
| Full cache hit, nothing changed | 0.14 s | 0.60 s (0.43 s with daemon) |
dist folders deleted, restored from cache | 0.19 s | 0.58 s |
Edit apps/api only (1 rebuild) | 0.86 s | 1.47 s |
Edit packages/utils (all 4 rebuild) | 2.62 s | 3.39 s |
--affected after editing apps/api | 0.92 s | 1.71 s |
Packages added to node_modules | 2 | 91 |
| Disk added (TypeScript excluded) | 50 MB | 70 MB |
Both tools got the graph right every time. The --affected runs, copied from the terminal:
Bash$ turbo run build --affected • turbo 2.11.13 • Packages in scope: @acme/api • Running build in 1 package • Remote caching disabled @acme/utils:build: cache hit, suppressing logs eb42e493f8a98dcc @acme/api:build: cache miss, executing 6ce3b0cad280ec34 Tasks: 2 successful, 2 total Cached: 1 cached, 2 total Time: 713ms
Bash$ nx affected -t build NX Affected criteria defaulted to --base=main --head=HEAD NX Running target build for project @acme/api and 1 task it depends on: > nx run @acme/utils:build [local cache] > nx run @acme/api:build NX Successfully ran target build for project @acme/api and 1 task it depends on Nx read the output from the cache instead of running the command for 1 out of 2 tasks. Run duration: 923ms Cache: 1/2 hit (50%)
Why Nx Lost Here, and Where It Wins
The gap in our table is almost entirely fixed cost per command. A cache hit in Turborepo is a Rust binary hashing files and copying them back. A cache hit in Nx starts Node.js, loads its plugins and computes the project graph before it can check the cache, which costs a few hundred milliseconds no matter how small the repo is. With the daemon running, the graph is already in memory and the full hit dropped from 0.60 to about 0.43 seconds, still about three times slower than Turborepo on a repo this size.
That fixed cost stops mattering as the repo grows. Nx's creator, Victor Savkin, maintains a public benchmark repo, vsavkin/large-monorepo, with 5 Next.js apps and roughly 26,000 components. Its February 12, 2025 results on an M2 Max averaged 191.7 ms for Nx against 1,432.4 ms for Turborepo, and the README says the gap widens as repos get bigger. It is a benchmark by the vendor, run on older versions of both tools, but the mechanism it describes is believable: the daemon keeps the graph and file hashes in memory and updates them incrementally, so the fixed cost we measured shrinks relative to the work as the repo grows.
Two things surprised us. Nx 24 no longer keeps its cache in the repo's .nx folder. Ours landed in ~/.nx/<workspace id>/cache, shared by every checkout and worktree of the repository (see nx/dist/src/utils/cache-directory.js), so deleting .nx does not clear it and our first "cold" runs were quietly served from cache. Use nx reset or NX_CACHE_DIRECTORY if you script around the cache. And with the daemon on, edits made milliseconds before a run were sometimes missed becuase the file watcher had not caught up. A codegen script followed immediately by nx build can hit that; a human will not.
What Remote Caching Costs
Local caching is free in both; the cost is the shared remote cache.
Turborepo's remote cache API is an open spec. Vercel Remote Cache is free on all plans, including Hobby, even if you do not host on Vercel, subject to fair use limits of 100 GB of uploads a month on Hobby and 1 TB on Pro. To keep artifacts on your own infrastructure, turbo login --manual points at any server implementing the spec; the docs list four community servers, the most active being ducktors/turborepo-remote-cache (MIT, 1,497 stars, last pushed November 27, 2026).
Nx publishes an OpenAPI spec for self-hosted caches too, so you can run your own. The managed path is Nx Cloud, and its rendered pricing table on November 30, 2026 read:
Pricing: Hobby $0 (50,000 credits/month, up to 5 active contributors) · Team from $29/month (5 contributors included, $19 each after) · CI Plan beta from $99/month, $0 base fee during the beta · Enterprise custom
What Nx Cloud sells beyond the cache is distributed task execution: splitting one CI run across many machines while it still feels like one command. Turborepo has no equivalent. Turborepo does not offer an equivalent; it runs tasks on the machine that started them. For a team whose CI wall-clock time is the bottleneck, that feature, not the local benchmark, is the real reason to pick Nx.
Boundaries, Generators and the Rest of the Toolbox
This is where the two products differ most. Nx ships a lint rule, @nx/enforce-module-boundaries, that fails the build when a project imports something its tags forbid, such as a scope:web library reaching into scope:api code. It also has generators that scaffold new libraries with consistent config, and plugins that infer build, test and lint targets from your existing Vite, Jest or ESLint configs so you do not repeat them in nx.json.
Turborepo added turbo boundaries, which flags imports from outside a package's directory and imports of packages not declared in package.json, plus tag-based rules declared per package. The docs still mark it experimental. For deployment, Turborepo has turbo prune --docker, which writes a pruned copy of the workspace with only the packages one app needs, split so Docker can cache the dependency install layer seperately from the source.
The Security Record
Both tools run with access to your CI secrets. On August 26, 2025, malicious versions of nx (including 20.9.0 through 20.12.0 and 21.5.0 through 21.8.0) and several @nx/* plugins were published to npm, as documented in advisory GHSA-cxm3-wv7p-598c (CVE-2025-10894, critical). The payload scanned the file system for credentials and pushed them to a GitHub repo named s1ngularity-repository created under the victim's own account, and Nx's timeline puts the first malicious publish at 6:32 PM EDT. The Nx repo lists 8 published advisories in total, 5 of them on September 11, 2026. Turborepo lists 3, all published May 14, 2026, the most serious a high-severity command injection in its VS Code extension rather than the CLI.
Neither count makes one tool safe. Both argue for pinning exact versions and committing the lockfile.
What About Vite+?
Vite+ from VoidZero is the newest option. Its vp run runs package.json scripts with caching, dependency ordering and workspace awareness, next to its dev server, test runner and linter. vite-plus 1.8.0 shipped on November 24, 2026 under MIT. It fits if you are adopting the Vite+ toolchain anyway; we did not benchmark it.
Side by Side
| Tool | Config | Cache hit (our repo) | Remote cache | Boundaries | License |
|---|---|---|---|---|---|
| Turborepo | turbo.json | 0.14 s | Vercel free, or self-host | Experimental | MIT |
| Nx | nx.json + plugins | 0.60 s (0.43 s daemon) | Nx Cloud from $0, or self-host | Lint rule, stable | MIT |
| Vite+ | vite.config.ts | Not tested | Not tested | Not tested | MIT |
How to Choose Without Migrating Twice
- Count your packages and your CI minutes. Under roughly 20 packages and a CI run under 10 minutes, the per-command overhead in our table is the difference you will feel every day, and Turborepo wins it.
- Run both on your real repo for an afternoon. Adding either is a config file and a dev dependency. Time a cold build, a no-op rebuild and an
--affectedrun on your own code before trusting anyone's chart, ours included. - Decide whether you want the tool to enforce structure. If teams keep importing each other's internals, Nx's boundary rule and generators do work Turborepo leaves to you.
- Price the remote cache with your team size. Vercel's free tier covers most teams. Nx Cloud's Hobby plan stops at 5 active contributors, after which Team starts at $29 a month plus $19 per extra contributor.
- Check whether CI wall time is the actual bottleneck. If a single CI run needs to fan out across many machines, that is Nx Cloud's distributed execution, and nothing in Turborepo replaces it.
Which One Should You Actually Use?
Small to mid-size TypeScript repo: Turborepo. It was faster in every scenario we measured, it is one small config file, and the remote cache costs nothing.
Large repo with many teams and code ownership problems: Nx. The module boundary rule, generators and incremental daemon pay for the extra 89 dependencies, and Nx's own benchmark suggests it pulls ahead on repos far bigger than ours.
CI takes 30 minutes or more and keeps growing: Nx with Nx Cloud, for distributed task execution. Turborepo's answer is a bigger CI machine.
Already standardizing on Vite and Vitest: look at Vite+ before adding a separate task runner, but treat it as early.
Conclusion
On a four-package workspace, Turborepo 2.11.13 beat Nx 24.1.0 on every timing we took, by 0.4 to 1 second per command, with 2 dependencies instead of 91. Nx's advantages show up elsewhere: the daemon on very large repos, the boundary lint rule, generators and distributed CI. The real question is whether you want a fast task runner or a platform that also shapes how your repo is organized.
Related DevToolLab Tools
- Monorepo Config Generator - generate a starting
turbo.jsonornx.jsonwith thedependsOnandoutputssettings used in the benchmark above. - TypeScript Config Generator - build the shared
tsconfig.base.jsonthat every package in a workspace extends, sotscoutput lands where your cacheoutputsexpect it. - Dockerignore Generator - keep
node_modules,.turboanddistout of the Docker build context next toturbo prune --docker. - Lockfile Analyzer - see what 91 extra packages look like in your lockfile and spot duplicate versions before they reach CI.
Related Guides
- Best Monorepo Management Tools - the wider roundup, including pnpm workspaces and Lerna on their own.
- GitHub Actions Best Practices - caching and securing the CI workflows that call
turboornx. - npm Supply Chain Attack Mitigation - the pinning and lockfile habits that limit damage from incidents like the August 2025 Nx compromise.
- Vercel Alternatives - where to deploy a Turborepo app if you use the free remote cache but not Vercel hosting.
