<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn" -->

---
title: Reducing the cost of string serialization in Node.js core
description: A deep dive explains how string serialization between C++ and JavaScript layers was a major bottleneck in Node.js URL operations. Working with Daniel Lemire,...
canonical: https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Reducing the cost of string serialization in Node.js core | daily.dev
og:description: A deep dive explains how string serialization between C++ and JavaScript layers was a major bottleneck in Node.js URL operations. Working with Daniel Lemire,...
og:url: https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn
og:image: https://api.daily.dev/og/posts/TYX4dR4Sn.png
og:image:alt: Reducing the cost of string serialization in Node.js core
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.

# Reducing the cost of string serialization in Node.js core

**[Yagiz Nizipli](https://daily.dev/sources/yagiz)** · 9 min read · 0 upvotes · 0 comments

## Summary

A deep dive explains how string serialization between C++ and JavaScript layers was a major bottleneck in Node.js URL operations. Working with Daniel Lemire, the author redesigned how the Ada URL parser communicates results to JavaScript, replacing per-property string serialization with an offset-based approach using a shared AliasedUint32Array buffer. This lazy-loading technique, landed in Ada v2.0.0 and Node.js 20, cut URL parsing time from about 140ms to 39ms per 100,000 URLs on an M1 Pro Max, while also reducing memory allocations.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.yagiz.co/reducing-the-cost-of-string-serialization-in-nodejs-core>

## Questions this post answers

### How much faster is URL parsing in Node.js 20 compared to Node.js 19.6.1?

Parsing 100,000 URLs takes about 38.97 milliseconds per iteration on Node.js 20 with Ada 2.0.0, versus 140.42 milliseconds on Node.js 19.6.1, roughly a 3.6x improvement. Node.js 19.8.1 with Ada 1.0.4 measured 79.29ms and Node.js 19.7.0 with Ada 1.0.1 measured 105.59ms, benchmarked on an M1 Pro Max.

_Track how Node.js URL parsing performance evolves across releases with daily.dev before upgrading._

### How does the Ada URL parser avoid the cost of serializing every URL property back to JavaScript?

Instead of serializing each URL property individually across the C++/JavaScript boundary, Ada 2.0.0 stores the full href string and uses an offsets-based approach to represent components like protocol, host, and pathname as substrings. A shared AliasedUint32Array buffer called url_components_buffer_ holds nine offsets, letting JavaScript read positions directly without repeated serialization calls.

_Developers optimizing hot-path native bindings can follow this Node.js interop pattern via daily.dev._

### What is an AliasedUint32Array used for in Node.js internals?

An AliasedUint32Array is a class that maps a native C++ buffer directly to a JavaScript-accessible object, allowing writes from native code without going through the JavaScript API layer. It is computationally efficient because it bypasses monitored write paths, though this also means VM change-detection mechanisms are circumvented; Node.js uses one instance to store URL component offsets.

_daily.dev helps engineers digging into Node.js native binding internals stay current on such techniques._

## Similar posts on daily.dev

- [Rewriting our Rust WASM Parser in TypeScript](https://daily.dev/posts/rewriting-our-rust-wasm-parser-in-typescript-l5hpi7vvy) · Hacker News · 19 upvotes · 1 comments
- [The Most Efficient Version of Your Library Was Never Written](https://daily.dev/posts/the-most-efficient-version-of-your-library-was-never-written-mdbdhcwcs) · Medium · 1 upvotes · 0 comments
- [We deserve a better streams API for JavaScript](https://daily.dev/posts/we-deserve-a-better-streams-api-for-javascript-x39tdohil) · Cloudflare · 75 upvotes · 3 comments
- [A space is a bit in a 32-byte table](https://daily.dev/posts/a-space-is-a-bit-in-a-32-byte-table-xsj0gnsbk) · Yagiz Nizipli · 7 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#nodejs](https://daily.dev/tags/nodejs), [#v8](https://daily.dev/tags/v8)

[View this post on daily.dev](https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn)

```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":"Reducing the cost of string serialization in Node.js core","url":"https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn"},"datePublished":"2026-09-13T19:57:46.763Z","dateModified":"2026-09-13T20:00:37.331Z","description":"A deep dive explains how string serialization between C++ and JavaScript layers was a major bottleneck in Node.js URL operations. Working with Daniel Lemire,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc5c6160ed0534307d59bca68160c942?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/bc5c6160ed0534307d59bca68160c942?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Yagiz Nizipli","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":"Yagiz Nizipli","logo":"https://media.daily.dev/image/upload/s--9Cscmaqk--/f_auto,q_auto/v1789329427/logos/yagiz?_a=BAMAMicg0","url":"https://daily.dev/sources/yagiz"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,nodejs,v8","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Yagiz Nizipli","item":"https://daily.dev/sources/yagiz"},{"@type":"ListItem","position":3,"name":"Reducing the cost of string serialization in Node.js core"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/reducing-the-cost-of-string-serialization-in-node-js-core-tyx4dr4sn#faq","mainEntity":[{"@type":"Question","name":"How much faster is URL parsing in Node.js 20 compared to Node.js 19.6.1?","acceptedAnswer":{"@type":"Answer","text":"Parsing 100,000 URLs takes about 38.97 milliseconds per iteration on Node.js 20 with Ada 2.0.0, versus 140.42 milliseconds on Node.js 19.6.1, roughly a 3.6x improvement. Node.js 19.8.1 with Ada 1.0.4 measured 79.29ms and Node.js 19.7.0 with Ada 1.0.1 measured 105.59ms, benchmarked on an M1 Pro Max. Track how Node.js URL parsing performance evolves across releases with daily.dev before upgrading."}},{"@type":"Question","name":"How does the Ada URL parser avoid the cost of serializing every URL property back to JavaScript?","acceptedAnswer":{"@type":"Answer","text":"Instead of serializing each URL property individually across the C++/JavaScript boundary, Ada 2.0.0 stores the full href string and uses an offsets-based approach to represent components like protocol, host, and pathname as substrings. A shared AliasedUint32Array buffer called url_components_buffer_ holds nine offsets, letting JavaScript read positions directly without repeated serialization calls. Developers optimizing hot-path native bindings can follow this Node.js interop pattern via daily.dev."}},{"@type":"Question","name":"What is an AliasedUint32Array used for in Node.js internals?","acceptedAnswer":{"@type":"Answer","text":"An AliasedUint32Array is a class that maps a native C++ buffer directly to a JavaScript-accessible object, allowing writes from native code without going through the JavaScript API layer. It is computationally efficient because it bypasses monitored write paths, though this also means VM change-detection mechanisms are circumvented; Node.js uses one instance to store URL component offsets. daily.dev helps engineers digging into Node.js native binding internals stay current on such techniques."}}]}
```

