<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis" -->

---
title: I built a 2x faster lexer, then discovered I/O was the...
description: Building a 2x faster ARM64 assembly lexer for Dart revealed that I/O, not lexing speed, was the bottleneck. Processing 104K files took 14.5 seconds for I/O...
canonical: https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I built a 2x faster lexer, then discovered I/O was the real bottleneck | daily.dev
og:description: Building a 2x faster ARM64 assembly lexer for Dart revealed that I/O, not lexing speed, was the bottleneck. Processing 104K files took 14.5 seconds for I/O...
og:url: https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis
og:image: https://api.daily.dev/og/posts/X9D2R1niS.png
og:image:alt: I built a 2x faster lexer, then discovered I/O was the real bottleneck
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.

# I built a 2x faster lexer, then discovered I/O was the real bottleneck

**[Lobsters](https://daily.dev/sources/lobsters)** · 11 min read · 0 upvotes · 0 comments

## Summary

Building a 2x faster ARM64 assembly lexer for Dart revealed that I/O, not lexing speed, was the bottleneck. Processing 104K files took 14.5 seconds for I/O versus 2.8 seconds for lexing due to syscall overhead from 300K+ open/read/close operations. Archiving files into tar.gz reduced I/O time by 43x (14.5s to 339ms) and total processing time by 2.3x, even with decompression overhead. This explains why package managers use archives: fewer syscalls, sequential reads, and compression outweigh decompression costs. Modern NVMe SSDs achieve peak performance only with sequential access to large files; thousands of small files cause syscall overhead to dominate. Alternatives like SQLite, io_uring, and ZIP archives offer different tradeoffs between random access and sequential performance.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://modulovalue.com/blog/syscall-overhead-tar-gz-io-performance/>

## Similar posts on daily.dev

- [Memory is slow, Disk is fast](https://daily.dev/posts/memory-is-slow-disk-is-fast-lns5ln4zk) · Lobsters · 1 upvotes · 0 comments
- [I/O is no longer the bottleneck?](https://daily.dev/posts/i-o-is-no-longer-the-bottleneck--jmvrrniwj) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#linux](https://daily.dev/tags/linux), [#compiler](https://daily.dev/tags/compiler), [#dart](https://daily.dev/tags/dart)

[View this post on daily.dev](https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis)

```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":"I built a 2x faster lexer, then discovered I/O was the real bottleneck","url":"https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis"},"datePublished":"2026-01-15T17:58:22.169Z","dateModified":"2026-01-15T17:58:51.079Z","description":"Building a 2x faster ARM64 assembly lexer for Dart revealed that I/O, not lexing speed, was the bottleneck. Processing 104K files took 14.5 seconds for I/O...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/819ad3b7d1e055725de2ee8172e4df2f?_a=AQAEulh","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/819ad3b7d1e055725de2ee8172e4df2f?_a=AQAEulh","isAccessibleForFree":true,"articleSection":"Lobsters","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":"Lobsters","logo":"https://media.daily.dev/image/upload/s--tl8v_Fku--/f_auto,t_logo/v1698841318/logos/lobste.jpg","url":"https://daily.dev/sources/lobsters"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-built-a-2x-faster-lexer-then-discovered-i-o-was-the-real-bottleneck-x9d2r1nis","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,linux,compiler,dart","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Lobsters","item":"https://daily.dev/sources/lobsters"},{"@type":"ListItem","position":3,"name":"I built a 2x faster lexer, then discovered I/O was the real bottleneck"}]}
```

