<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu" -->

---
title: How Dependency Size Impacts Cold Starts in Edge...
description: A hands-on benchmark compares Valibot 1.3.1 and Zod 4.3.6 bundle sizes for an identical schema built with Wrangler 4.81.1, finding Valibot's gzipped output is...
canonical: https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How Dependency Size Impacts Cold Starts in Edge JavaScript Runtimes | daily.dev
og:description: A hands-on benchmark compares Valibot 1.3.1 and Zod 4.3.6 bundle sizes for an identical schema built with Wrangler 4.81.1, finding Valibot's gzipped output is...
og:url: https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu
og:image: https://api.daily.dev/og/posts/YV5D6ACNu.png
og:image:alt: How Dependency Size Impacts Cold Starts in Edge JavaScript Runtimes
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How Dependency Size Impacts Cold Starts in Edge JavaScript Runtimes

**[Valibot: The modular and type safe schema library](https://daily.dev/sources/valibot)** · 7 min read · 0 upvotes · 0 comments

## Summary

A hands-on benchmark compares Valibot 1.3.1 and Zod 4.3.6 bundle sizes for an identical schema built with Wrangler 4.81.1, finding Valibot's gzipped output is 9.8x smaller (2.72 KiB vs 26.75 KiB). The gap stems from architectural differences: Zod's class-based, chainable API couples shared internals together so bundlers pull in more code, while Valibot's standalone functions allow fine-grained tree-shaking. Since edge runtimes must load and evaluate an entire bundle before serving the first request, larger bundles mean more work during cold starts, which matters most during deployments and traffic spikes. The piece notes this doesn't affect long-lived, warm services much, and points to Valibot's Standard Schema support, tRPC/Hono/Conform/React Hook Form integrations, and a Zod-to-Valibot migration guide with a codemod.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://valibot.dev/blog/dependency-size-and-cold-starts>

## Questions this post answers

### How much smaller is Valibot's bundle compared to Zod for the same schema?

Valibot's gzipped bundle is 9.8 times smaller than Zod's for an identical User schema. In a Cloudflare Worker built with Wrangler 4.81.1, Zod 4.3.6 produced a 141.43 KiB raw bundle (26.75 KiB gzipped), while Valibot 1.3.1 produced 11.92 KiB raw (2.72 KiB gzipped) for the same fields: name, email, age, and role.

_Comparing validation library footprints before picking one is exactly the kind of research daily.dev surfaces for developers._

### Why does Zod produce a larger bundle than Valibot even when both use similar validation APIs?

Zod uses a class-based, chainable API where shared internals like parsing logic and error handling are tightly coupled, so bundlers pull them in together even for a small schema, a coarse-grained import pattern. Valibot instead exposes each validator as a small standalone function, letting bundlers include only the exact functions referenced and drop the rest, a fine-grained import model.

_Understanding why a library's API design affects tree-shaking helps teams evaluating dependencies find that context on daily.dev._

### Does switching from Zod to Valibot mean losing integrations with tools like tRPC or React Hook Form?

No, Valibot works with the same ecosystem tools teams already use. It implements the Standard Schema specification for native compatibility without adapters, integrates directly with tRPC's .input(), and has dedicated packages for React Hook Form (@hookform/resolvers/valibot), Hono (@hono/valibot-validator), and Conform (@conform-to/valibot). A migration guide with a codemod also exists to convert Zod schemas.

_Developers weighing a schema library migration can track integration and compatibility details like these on daily.dev._

## Similar posts on daily.dev

- [Why is Zod so slow?](https://daily.dev/posts/why-is-zod-so-slow--huyq3zzbb) · LogRocket · 27 upvotes · 1 comments
- [Valibot v1.5: Faster schema construction, Unicode code points, and stricter validation](https://daily.dev/posts/valibot-v1-5-faster-schema-construction-unicode-code-points-and-stricter-validation-fcqzm9kyo) · Valibot: The modular and type safe schema library · 5 upvotes · 1 comments
- [Seven cool JavaScript libraries You should know about](https://daily.dev/posts/seven-cool-javascript-libraries-you-should-know-about-32pqekrej) · Neciu Dan · 25 upvotes · 3 comments

---

Tags: [#cloudflare](https://daily.dev/tags/cloudflare), [#edge-computing](https://daily.dev/tags/edge-computing), [#zod](https://daily.dev/tags/zod)

[View this post on daily.dev](https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How Dependency Size Impacts Cold Starts in Edge JavaScript Runtimes","url":"https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu"},"datePublished":"2026-08-23T12:19:52.156Z","dateModified":"2026-08-23T12:40:48.301Z","description":"A hands-on benchmark compares Valibot 1.3.1 and Zod 4.3.6 bundle sizes for an identical schema built with Wrangler 4.81.1, finding Valibot's gzipped output is...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7d01159386758a77b64eef09420d1ba7?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/7d01159386758a77b64eef09420d1ba7?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Valibot: The modular and type safe schema library","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Valibot: The modular and type safe schema library","logo":"https://media.daily.dev/image/upload/s--GHNQZY4x--/f_auto,q_auto/v1787487507/logos/valibot?_a=BAMAMicg0","url":"https://daily.dev/sources/valibot"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"cloudflare,edge-computing,zod","timeRequired":"PT7M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Valibot: The modular and type safe schema library","item":"https://daily.dev/sources/valibot"},{"@type":"ListItem","position":3,"name":"How Dependency Size Impacts Cold Starts in Edge JavaScript Runtimes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/how-dependency-size-impacts-cold-starts-in-edge-javascript-runtimes-yv5d6acnu#faq","mainEntity":[{"@type":"Question","name":"How much smaller is Valibot's bundle compared to Zod for the same schema?","acceptedAnswer":{"@type":"Answer","text":"Valibot's gzipped bundle is 9.8 times smaller than Zod's for an identical User schema. In a Cloudflare Worker built with Wrangler 4.81.1, Zod 4.3.6 produced a 141.43 KiB raw bundle (26.75 KiB gzipped), while Valibot 1.3.1 produced 11.92 KiB raw (2.72 KiB gzipped) for the same fields: name, email, age, and role. Comparing validation library footprints before picking one is exactly the kind of research daily.dev surfaces for developers."}},{"@type":"Question","name":"Why does Zod produce a larger bundle than Valibot even when both use similar validation APIs?","acceptedAnswer":{"@type":"Answer","text":"Zod uses a class-based, chainable API where shared internals like parsing logic and error handling are tightly coupled, so bundlers pull them in together even for a small schema, a coarse-grained import pattern. Valibot instead exposes each validator as a small standalone function, letting bundlers include only the exact functions referenced and drop the rest, a fine-grained import model. Understanding why a library's API design affects tree-shaking helps teams evaluating dependencies find that context on daily.dev."}},{"@type":"Question","name":"Does switching from Zod to Valibot mean losing integrations with tools like tRPC or React Hook Form?","acceptedAnswer":{"@type":"Answer","text":"No, Valibot works with the same ecosystem tools teams already use. It implements the Standard Schema specification for native compatibility without adapters, integrates directly with tRPC's .input(), and has dedicated packages for React Hook Form (@hookform/resolvers/valibot), Hono (@hono/valibot-validator), and Conform (@conform-to/valibot). A migration guide with a codemod also exists to convert Zod schemas. Developers weighing a schema library migration can track integration and compatibility details like these on daily.dev."}}]}
```

