---
title: "500x faster postMessage(string)"
url: https://daily.dev/posts/500x-faster-postmessage-string--gpjaltzuz
source_url: https://bun.com/blog/how-we-made-postMessage-string-500x-faster
type: article
source: "Bun"
published: 2025-08-20T23:37:44.571Z
updated: 2025-08-20T23:38:05.442Z
tags: ["webdev", "javascript", "performance", "bun"]
reading_time: 3
upvotes: 68
comments: 0
language: 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.

# 500x faster postMessage(string)

**[Bun](https://daily.dev/sources/bun)** · 3 min read · 68 upvotes · 0 comments

## Summary

Bun v1.2.21 introduces a zero-copy optimization for postMessage(string) that achieves up to 500x faster performance and 22x less memory usage by avoiding serialization for thread-safe strings. The optimization works by directly sharing immutable string pointers between threads in JavaScriptCore, bypassing the Structured Clone Algorithm for strings that aren't atoms, substrings, or rope strings. This dramatically improves performance for common patterns like sending JSON between workers, with the optimization automatically applying to strings over 256 characters.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bun.com/blog/how-we-made-postMessage-string-500x-faster>

## Similar posts on daily.dev

- [Bun v1.2.22](https://daily.dev/posts/bun-v1-2-22-ptoglize2) · Bun · 60 upvotes · 0 comments
- [Bun v1.3.7](https://daily.dev/posts/bun-v1-3-7-0otwuahrf) · Bun · 15 upvotes · 1 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript), [#performance](https://daily.dev/tags/performance), [#bun](https://daily.dev/tags/bun)

[View this post on daily.dev](https://daily.dev/posts/500x-faster-postmessage-string--gpjaltzuz)
