Skip to main content

Vercel Flags starts 7x faster and no longer extends function duration

By Steven Van ·

Updating @flags-sdk/vercel to 1.5.3 cuts p75 cold-start initialization from over 70 ms to 10 ms and stops usage reporting from adding function time.

The Vercel Flags SDK now starts faster on cold starts, and its usage reporting no longer keeps functions running after the response is sent. Both changes apply to apps running on Vercel, as announced in the Flags SDK documentation.

Faster cold starts

Two changes speed up SDK initialization:

  • The SDK loads and parses the flags datafile bundled with the deployment as soon as the client is created, so it is ready before the code evaluates its first flag.
  • Every function invocation now includes the current datafile revision, so the SDK can check whether the bundled datafile is up to date without a network request.

In Vercel's internal testing, removing the network wait cut p75 cold-start SDK initialization time from over 70 ms to 10 ms, roughly 7x faster. After initialization, flag reads are effectively instant: across cold and warm invocations, p99 flag-read latency is under 1 ms.

Usage reporting no longer extends function duration

The SDK previously used waitUntil for usage reporting, which kept functions running after the response was sent. It now passes usage events to the Vercel runtime, so reporting no longer adds to function duration.

How to get it

Update @flags-sdk/vercel to version 1.5.3 or later and redeploy the application, for example with pnpm add @flags-sdk/vercel@latest.

Vercel
Vercel
The platform for frontend developers — deploy, preview, and scale web apps and AI agents with zero config.
View Vercel →
Sources

Original source

Read Vercel Flags starts 7x faster and no longer extends function duration on Creators Toolbox