{
  "id": 21644752,
  "title": "The \"Security Tax\": Reclaiming 30% Performance in WSL 2",
  "url": "https://urgent.news/2026/11/24/the-security-tax-reclaiming-30-performance-in-wsl-2",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-24T18:45:22.000Z",
  "source": {
    "name": "Lobsters",
    "slug": "lobsters",
    "url": "https://tonym.us/wsl2-security-tax-reclaiming-performance"
  },
  "original_language": "en",
  "account": "For developers operating lightweight systems within WSL 2, every megabyte of RAM and CPU cycle matter greatly. However, they may not be aware of the considerable \"performance tax\" introduced by kernel-level countermeasures for vulnerabilities such as Spectre and Meltdown. A recent set of tests was carried out on a Go-based backend application, and disabling these safeguards led to a 31.7% improvement in wall-clock compilation time.\n\nThis article explains how to examine your system and decide if the trade-off is appropriate for your working style. Compilation tasks are particularly \"syscall-heavy\". Every time the compiler accesses a header file, opens a file, or links a library, it communicates with the kernel. When mitigations are enabled, thousands of these transitions cause the CPU to \"sanitize\" its state, leading to a slowdown in the whole process. The most telling statistic is the reduction in System Time. By turning off mitigations, the time spent inside the kernel decreased by nearly half, enabling the CPU to devote more time to compiling code (as shown by the increase in CPU efficiency).\n\nTo check if your kernel is currently being \"taxed\", you can inspect the CPU vulnerabilities directory. To turn off these settings, you must modify the Windows-side configuration file located at %UserProfile%\\.wslconfig. This will disable the security tax and set a strict memory limit, resulting in a snappier and more efficient environment. After saving the file, run wsl --shutdown in PowerShell for the changes to take effect.\n\nFor local development machines used for compiling languages like Go, C++, or Rust, the 30% speed increase is frequently deemed worth the calculated risk. A single line of kernel configuration can provide a performance boost comparable to $1000+ worth of hardware enhancements.",
  "summary": "A significant WSL2 performance issue I wrote about in march now has a better RCA and reproduction steps. You can get 50+% better build performance with kernelCommandLine=spec_rstack_overflow=off see also https://github.com/microsoft/WSL/issues/41827 Comments",
  "key_points": [
    "Disabling Spectre and Meltdown mitigations in WSL 2 boosts performance by 31.7%",
    "System Time reduction nearly halves, CPU efficiency increases significantly",
    "Turning off mitigations via %UserProfile%\\.wslconfig file enables performance boost"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}