# Go Stack Allocation Boosts Uber CPU Efficiency _Uber engineers optimized Go stack allocation, cutting CPU usage by up to 10% in critical services through static pre-allocation and disabling dynamic growth._ **Updated:** 2026-08-22 **Published:** 2026-05-28 **Source:** https://www.startuphub.ai/ai-news/technology/2026/go-stack-allocation-boosts-uber-cpu-efficiency --- Uber is squeezing more performance out of its massive Go deployment. The ride-sharing giant has detailed how tweaking Go's stack allocation mechanisms slashed CPU usage by as much as 10% in key services, translating to significant operational cost reductions across millions of cores. This breakthrough, reported by [Uber Engineering](https://www.uber.com/us/en/blog/zero-growth-stack/), underscores the critical role of granular optimizations for large-scale cloud infrastructure. Go Stack ExpansionDrivergoroutines dynamically doubling stack size and copying dataFrom the article 9+ mentionsAt Uber's scale, where 1% efficiency gains equate to millions of dollars, minimizing this 'stack expansion' is paramount.causesCPU UsageDriverrepeated stack growth consumes significant CPU cycles at scaleFrom the article 9 mentionsThe ride-sharing giant has detailed how tweaking Go's stack allocation mechanisms slashed CPU usage by as much as 10% in key services, translating to significant operational cost reductions across millions of cores.impactsUber's Go DeploymentCoremassive scale where efficiency gains mean millions of dollarsFrom the article 7 mentionsUber is squeezing more performance out of its massive Go deployment.Static Pre-allocationCoredisabling dynamic stack growth for critical servicesFrom the articleBy disabling Go's adaptive stack sizing and stack shrinking features, and then pre-allocating goroutine stacks to a static, larger size, they aimed to eliminate the costly dynamic expansion process.Granular OptimizationsContextFrom the article 2 mentionsThis breakthrough, reported by Uber Engineering, underscores the critical role of granular optimizations for large-scale cloud infrastructure.viaTuning RuntimeCoreoptimizing Go's stack allocation mechanisms for performanceFrom the article 6 mentionsThis effort highlights how even mature platforms like Go can benefit from deep, specialized tuning for extreme scale.leads toCPU Efficiency BoostEffectcutting CPU usage by up to 10% in key servicesFrom the articleThis focus on CPU efficiency in Go services is reminiscent of other efforts, such as mimalloc: Microsoft's Speed Boost for Apps.results inCost ReductionOutcomeFrom the article 2 mentionsThe ride-sharing giant has detailed how tweaking Go's stack allocation mechanisms slashed CPU usage by as much as 10% in key services, translating to significant operational cost reductions across millions of cores. Go’s runtime, designed for efficiency, uses goroutines which have much smaller initial stack sizes (2KB) compared to OS threads (2MB). When a goroutine's stack fills up, Go dynamically doubles its size and copies the data, a process that consumes CPU cycles. At Uber's scale, where 1% efficiency gains equate to millions of dollars, minimizing this 'stack expansion' is paramount. ## The Stack Expansion Problem While Go 1.19 introduced adaptive stack sizing to improve initial allocation, it wasn't enough for all workloads. Uber found that repeated stack growth remained a significant CPU drain in some services. One service, in particular, showed nearly 10% of its CPU consumption attributed to stack growth, despite having ample memory available. ## Tuning the Runtime Uber explored two main paths: goroutine pooling and customizing the Go runtime. Goroutine pooling requires substantial code changes and introduces its own overhead. Instead, Uber opted to modify the Go runtime directly. By disabling Go's adaptive stack sizing and stack shrinking features, and then pre-allocating goroutine stacks to a static, larger size, they aimed to eliminate the costly dynamic expansion process. This involved patching the Go source code to expose and control internal variables related to stack size. The team developed an analysis tool that inspects Go binaries to determine the actual stack usage of functions. This allowed them to statically set optimal stack sizes, preventing runtime overrides and minimizing the performance impact. ## Impact and Future The results were dramatic. One service saw its stack growth CPU cost drop from nearly 10% to under 1% after increasing the stack size from the default 2KB to 32KB. Memory usage increased, but remained well within container limits. Uber plans to expand this optimization across more services, focusing on those with high CPU usage from stack growth and relatively low memory footprints. This approach, while requiring internal runtime modifications, demonstrates the potential for significant gains by optimizing core language features for specific operational demands. This effort highlights how even mature platforms like Go can benefit from deep, specialized tuning for extreme scale. This focus on CPU efficiency in Go services is reminiscent of other efforts, such as [mimalloc: Microsoft's Speed Boost for Apps](/ai-news/ai-research/2026/mimalloc-microsoft-s-speed-boost-for-apps). --- Original analysis from [startuphub.ai](https://www.startuphub.ai), the #1 AI startup directory. © StartupHub.ai. All rights reserved. You may not republish this article in full without a license. Search engines and AI research tools may crawl and summarize for reference. Bulk reproduction or model training on this content requires a license. See https://www.startuphub.ai/terms.