Marvin Hagemeister
Read post

Speeding up the JavaScript ecosystem - oxlint and oxfmt

A deep-dive into a performance bottleneck discovered in oxlint and oxfmt when run on codebases with many directories. The root cause was excessive syscalls during config file discovery: each `.is_file()` call triggers a full kernel context switch, and with 150k sequential calls across 50k directories, this created massive latency. The fix replaces individual `is_file()` checks with `readdir`-based traversal, which returns filenames and file types for free without extra syscalls. Additionally, the two-phase approach (config discovery then linting) was fused into a single traversal pass. The result is a ~50% speedup (6.1s → 2.8s) for large projects with many directories.

    #javascript#performance#rust
May 17•6m read time•From marvinh.dev
Post cover image
Table of contents
Why are you idling, CPU?The syscall ghostZero cost discovery with readdirGetting rid of phasesRemember: Syscalls are expensive
145.7K Impressions5 Comments
Marvin Hagemeister's image
Marvin Hagemeister

11 Followers

•

210 Upvotes

Would you recommend this post?

Copy link
WhatsApp
Facebook
X
New Squad
  • © 2026 Daily Dev Ltd.
  • Guidelines
  • Explore
  • Tags
  • Sources
  • Squads
  • Leaderboard