Python function bundles now include precompiled bytecode
By Dillip Chowdary • Jul 21, 2026 • Source: Vercel Blog
Vercel now compiles Python functions to bytecode at build time and ships the resulting .pyc files in the function bundle. In Vercel’s benchmarks, cold starts for the median-sized function fell from 2.8s to 1.3s. The change covers both application code and dependencies, not only user-written modules.
Python normally pays a compile cost when a module is imported without cached bytecode: it parses source, compiles it, then runs. That step stacks up on large dependency trees and shows up as cold-start latency. By producing bytecode during the build and packing .pyc files into the deployable bundle, Vercel removes that work from the cold path so import time is closer to load-and-execute than parse-compile-execute.
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
For engineers running Python on Vercel functions, the gain is concrete: roughly half the cold-start time on a median-sized function in those benchmarks. Teams with heavy import graphs—frameworks, data libraries, large third-party trees—are the ones most exposed to the old parse-and-compile tax, so they stand to see the largest relative improvement when the platform already holds .pyc for app code and deps.
The move treats cold start as a packaging problem as much as a runtime one. Serverless Python has long been constrained by import and compile cost on large trees; prebaking bytecode into the bundle is a platform-side fix rather than asking developers to slim imports or redesign handlers. It positions Vercel’s Python path around deploy artifact content, not only how the runtime boots.
What to watch next: whether your own functions track the 2.8s → 1.3s median drop, especially when dependency trees grow or shrink, and whether build pipelines and bundle size stay acceptable once .pyc for app and deps is always included. Measure cold start before and after on representative handlers; that is the check that matters more than the headline number.
Advertisement