Optimizing Windows 11 for CS2 and ComfyUI: From Wi-Fi to P-Cores
A battle-tested Windows 11 guide: kill 300ms Wi-Fi lag spikes, isolate P-cores for CS2, and buffer 64GB virtual RAM for ComfyUI without crippling E-cores in BIOS.

Many software engineers and power users share an oddly specific hardware setup: a beefy Windows 11 rig running an Intel hybrid CPU, an RTX card with 12GB VRAM, and 32GB RAM. By day, it serves as a private AI inference engine churning through ComfyUI diffusion graphs. By night, it turns into a competitive esports machine for Counter-Strike 2 (CS2).
In theory, this hardware should breeze through both. In reality, you are caught between two diametrically opposed worlds. Right as you hold a pixel-perfect angle in a clutch round, an inexplicable 200ms frame stutter occurs because Windows Thread Director dumped Source 2 sub-tick packets onto a power-saving efficiency core, while your Wi-Fi card dropped packets to scan for neighborhood routers. The next morning, you load a 15GB video diffusion checkpoint into ComfyUI, only for Windows Defender to pin CPU usage at 100% while the process crashes to desktop due to an exhausted virtual memory pool.
Most optimization guides on Reddit will hand you two disastrous tips: disable E-cores in BIOS, and delete the Windows pagefile to “save SSD endurance.” Follow that advice, and you will cripple your workstation multi-threading and guarantee that heavy diffusion models never finish a single run.
TL;DR
Quick Answer Box (Google Search Featured Snippet):
- What is the Windows 11 CS2 and ComfyUI optimization framework? It is an adaptive resource-orchestration workflow that dynamically isolates high-frequency P-cores and locks background Wi-Fi discovery for CS2, while preserving all 16 compute threads and a 64GB virtual memory buffer for ComfyUI.
- Eliminating Wi-Fi Jitter: Freezing Windows WLAN AutoConfig in the background flattens periodic 300ms packet latency spikes into a rock-solid 2ms baseline over 5GHz Wi-Fi.
- Preserving Hybrid Cores: Avoid disabling efficiency cores in BIOS. A lightweight PowerShell daemon dynamically assigns affinity masks only when the game process launches.
- Operational Safety: No aggressive firmware overclocking or destructive registry hacks; all modifications run dynamically via scripts and restore system state upon exit.
- Zero Wi-Fi Jitter: Freezing periodic 60-second background discovery sweeps keeps latency rock-solid without needing an ethernet cable across the apartment.
- Dynamic P-Core Affinity: Binary affinity masks isolate CS2 strictly to Performance Cores, preserving all E-cores for video encoding and image tiling in ComfyUI.
- AI I/O Acceleration: Adding safetensors model directories to Windows Defender exclusions cuts model loading latencies in half.
- Stable Latent Paging: Allocating a static 32GB pagefile on NVMe storage creates a 64GB combined memory buffer, preventing crash-to-desktop errors during large Flux and Wan 2.1 runs.
Pitfall 1: Disabling E-Cores in BIOS Is a Trap
When facing micro-stutters in CS2 (where the frame counter claims 240 FPS but the screen visibly hitches), the top recommendation on gaming forums is almost universal: “Go to BIOS and disable Efficiency Cores. Stutters disappear instantly.”
It is true that disabling E-cores prevents Windows Thread Director from misallocating critical sub-tick render threads to low-clocked cores. Game frametimes improve slightly. But nobody talks about the operational damage waiting on the other side.
When you switch back to ComfyUI, tasks like parallel image tiling, text encoder tokenization, latent decompression, and FFmpeg video encoding rely heavily on raw thread count. Stripping away 4 to 8 efficiency cores doubles preprocessing times before every sampling pass. You essentially castrate a modern 14th-gen processor into a five-year-old budget CPU.
The professional solution is not in the BIOS. It is setting Process Affinity Masks inside Windows: let the processor keep all its cores, but whenever cs2.exe spawns, force the game to run exclusively on high-frequency P-cores.
Pitfall 2: 5GHz Wi-Fi and the 60-Second Hitch
Not every workspace allows running a physical Cat6 cable across the living room, especially with child barriers or rented apartments without wall conduits. 5GHz Wi-Fi easily delivers 500Mbps to 800Mbps of throughput, yet competitive shooters experience jarring hitching.
The pattern is clockwork: roughly every 60 seconds, exactly as you peek around a corner, ping shoots from 2ms to 250ms - 300ms for a split second before recovering.
The culprit is not router congestion, but Windows 11 itself:
- WLAN AutoConfig Service: Every minute, Windows broadcasts wireless probe requests in the background to refresh its nearby network list. During this 200ms sweep, the wireless adapter temporarily halts incoming UDP game packets.
- Human Presence Detection: Certain Wi-Fi adapters feature proximity-based RF throttling (SAR) that reduces transmit power when humans sit nearby. On a stationary desktop PC, this causes erratic signal degradation.
By locking background discovery services while in-game and fixing the adapter transmit power to its highest setting, Wi-Fi latency flattens into a clean 2ms line identical to wired ethernet.
Architecture: The GameMode Sentinel Engine
Instead of executing manual tweaks every time you change tasks, this entire workflow is automated via GameMode Sentinel, a lightweight PowerShell daemon running as a Windows Scheduled Task.
The automatic dispatch lifecycle:
- When
cs2.exeis detected: Sentinel freezes background Wi-Fi discovery, sets CPU affinity to P-cores, raises process priority to High, and switches the Windows power plan to High Performance. - When the game terminates: Sentinel instantly restores the Balanced power plan, re-enables Wi-Fi scanning, and hands all processor threads back to ComfyUI.
Hands-On Implementation: Taming the System
Follow these tested implementation steps on your Windows rig.
1. Eliminating Wi-Fi Jitter and Network Buffering
Launch an elevated PowerShell prompt to optimize the TCP/IP stack:
# Enable BBR congestion control and remove multimedia packet throttling
netsh int tcp set supplemental template=internet congestionprovider=bbr2
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "NetworkThrottlingIndex" -Value 0xFFFFFFFF
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile" -Name "SystemResponsiveness" -Value 0
Inside your Wi-Fi adapter properties (Device Manager -> Network adapters -> Properties -> Advanced):
- Roaming Aggressiveness: Set to
1. Lowest(stops needless channel jumping). - Preferred Band: Set to
5GHz. - Packet Coalescing: Set to
Disabled. - Human Presence Detection: Set to
Disabled(if available).
2. The GameMode Sentinel Automation Script
Create a script file at C:\Scripts\GameModeSentinel.ps1:
# GameModeSentinel.ps1 - Dynamic Resource Orchestration
$isGameActive = $false
while ($true) {
$process = Get-Process -Name "cs2" -ErrorAction SilentlyContinue
if ($process -and -not $isGameActive) {
# 0x0FFF: Selects the first 12 threads (Cores 0-11, matching 6 P-Cores with hyper-threading)
$process.ProcessorAffinity = [IntPtr]0x0FFF
$process.PriorityClass = [System.Diagnostics.ProcessPriorityClass]::High
# Freeze background Wi-Fi discovery
netsh wlan set autoconfig enabled=no interface="Wi-Fi" | Out-Null
# Switch to High Performance power plan
powercfg /setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
$isGameActive = $true
}
elseif (-not $process -and $isGameActive) {
# On game exit: Re-enable Wi-Fi scanning and revert to Balanced
netsh wlan set autoconfig enabled=yes interface="Wi-Fi" | Out-Null
powercfg /setactive 381b4222-f694-41f0-9685-ff5bb260df2e
$isGameActive = $false
}
Start-Sleep -Seconds 3
}
Register this script as a Windows Scheduled Task triggered at system startup, running under the SYSTEM account with highest privileges.
3. Sub-Tick CS2 Engine and NVIDIA Reflex Directives
Add these configuration lines into your autoexec.cfg:
rate 1000000
cl_net_buffer_ticks 0
engine_low_latency_sleep_after_client_tick true
r_low_latency 2
The r_low_latency 2 variable enables NVIDIA Reflex + Boost mode, locking GPU clocks at peak frequency during CPU-bound ticks to eliminate frame presentation latency.
4. Maximizing ComfyUI Local AI Throughput
When shifting focus back to generative AI:
- Windows Defender Exclusions: Add your ComfyUI root and
modelsdirectories to Windows Defender Antivirus exclusions. This stops real-time scanning from locking 15GB safetensors files during model loads, cutting wait times by 50%. - Static 32GB NVMe Pagefile: Set both Initial and Maximum pagefile size to
32768MB on your fastest NVMe SSD. Combined with 32GB physical RAM, this guarantees a 64GB address space, eliminating crash-to-desktop errors during high-resolution Wan 2.1 video diffusion runs. - PyTorch Memory Variables: Declare
CUDA_MODULE_LOADING=LAZYandPYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512in your ComfyUI launch scripts to prevent VRAM memory fragmentation.
Three Lethal Pitfalls to Avoid
Before applying random system optimization scripts circulating online, beware of these silent failures:
- The Permanent Wi-Fi Lock Trap: If you disable
autoconfigmanually without an automatic recovery loop, your PC will never reconnect to Wi-Fi if your router reboots or switches channels. A background watcher must always handle recovery. - The MTU Mismatch Penalty: Forcing an improper Maximum Transmission Unit (such as 1500 bytes over PPPoE connections requiring 1492) forces upstream routers to fragment packets. You will clearly see your crosshairs on an enemy, but the server will silently drop the hit.
- The Zero-Pagefile Fallacy: The myth that disabling pagefiles “saves SSD endurance” is outdated. Windows and PyTorch rely heavily on virtual memory paging. Disabling it does not make your system faster, but will reliably crash applications during heavy tensor transformations.
Configuration Decision Matrix
| Optimization Target | Apply immediately if… | Skip if… |
|---|---|---|
| P-Core Affinity Pinning | Running Intel 12th, 13th, or 14th gen hybrid CPUs | Running AMD Ryzen processors with uniform cores |
| WLAN AutoConfig Freezing | Gaming over 5GHz Wi-Fi connections | Connected via direct Cat6 gigabit ethernet |
| 32GB NVMe Pagefile | Generating Flux or Wan 2.1 models on 12GB VRAM | Running lightweight SD1.5 checkpoints with 64GB physical RAM |
Reflex + Boost (r_low_latency 2) |
Paired with an NVIDIA RTX GPU and high refresh display | Running integrated graphics or older legacy GPUs |
Final Words from the Trenches
Do not cripple a high-end multi-purpose workstation with scorched-earth BIOS modifications. True engineering discipline relies on automated, context-aware scheduling: extracting every microsecond of gaming responsiveness when you compete, while retaining every cycle of compute power for demanding creative workloads.
FAQ
Does disabling WLAN AutoConfig interrupt active Internet traffic?
No. The command only suspends background searching for new access points. Your active Wi-Fi connection continues transmitting packets with increased consistency and lower jitter.
Is disabling Human Presence Detection on the Wi-Fi card safe?
Yes. Wi-Fi operates in the non-ionizing radiofrequency spectrum at milliwatt power levels. This driver feature exists primarily to meet laptop chassis proximity regulations, which are not relevant for stationary desktop towers.
Why does ComfyUI require a 32GB pagefile when physical RAM is already present?
Modern generative checkpoints range from 10GB to 24GB in size. During model offloading and tensor transformations between system memory and GPU VRAM, PyTorch requires a large virtual buffer to prevent memory allocation faults.
Which processors benefit from the 0x0FFF affinity mask?
This binary mask targets the first 12 execution threads, matching 6-core/12-thread P-core layouts (such as Intel Core i5-13400, 14400F, or comparable models). For an 8-core P-core configuration, use 0x0000FFFF.
Related posts
- AI & Agents
How to Find the Best AI Model to Optimize Your PC Hardware
A pragmatic guide to choosing local LLMs for your GPU with LM Studio. Understand VRAM limits, quantization trade-offs, and full GPU offload.
11 min readRead → - AI & Agents
Krea 2 Turbo: Why 16-Channel Latents and ConvRot Beat 24GB GPUs
How Krea 2 Turbo delivers photorealistic chiaroscuro and candid depth on a 12GB GPU using 16-channel Wan VAE latents and ConvRot INT8 quantization.
8 min readRead → - AI & Agents
Qwen-Image-2.1 Uncensored: Run Unrestricted ComfyUI with GGUF & Heretic
Master running Qwen-Image-2.1 Uncensored in ComfyUI using GGUF DiT and Heretic Text Encoder. Bypass refusal filters and optimize VRAM on RTX and Apple Silicon.
26 min readRead → - System Design
Python Concurrency: Understanding GIL, Threading, and Multiprocessing from First Principles
In-depth guide to Python Concurrency: Master the GIL, understand Threading vs Multiprocessing, optimize I/O vs CPU workloads, and backend architecture.
11 min readRead →