Skip to Content
Benchmarks

Benchmarks

Rush-FS excels at recursive and batch filesystem operations where Rust’s parallel walkers deliver significant speedups (e.g. 12× readdir, 50× copyFile). Single-file operations and recursive glob are on par with Node.js.

Tested on Apple Silicon (arm64), Node.js 24.0.2, release build with LTO. Run pnpm build && pnpm bench in the repo  to reproduce.

Where Rush-FS shines

ScenarioNode.jsRush-FSSpeedup
readdir recursive (node_modules, ~30k entries)281 ms23 ms12x
copyFile 4 MB4.67 ms0.09 ms50x
readFile 4 MB utf81.86 ms0.92 ms2x
rm 2000 files (4 threads)92 ms53 ms1.75x
cp 500-file flat dir (4 threads)86.45 ms32.88 ms2.6x
cp tree dir ~363 nodes (4 threads)108.73 ms46.88 ms2.3x
glob large tree (node_modules/**/*.json, ~30k entries)fast-glob 303 ms30 ms~10x

On par with Node.js

Single-file operations have a ~0.3 µs napi bridge overhead. On large, deep trees glob wins (see “Where Rush-FS shines”); on small/medium trees node-glob is faster (see “Where Node.js wins”). Other operations:

ScenarioNode.jsRush-FSRatio
stat (single file)1.45 µs1.77 µs1.2x
readFile small (Buffer)8.86 µs9.46 µs1.1x
writeFile small (string)74 µs66 µs0.9x
appendFile30 µs27 µs0.9x

Where Node.js wins

For very lightweight built-in calls, napi overhead dominates; on small/medium trees, node-glob is faster than Rush-FS glob:

ScenarioNode.jsRush-FSNote
existsSync (existing file)444 ns1.34 µsNode.js internal fast path
accessSync F_OK456 ns1.46 µsSame
glob recursive (**/*.rs, small tree) vs node-glob22 ms40 msnode-glob faster at this scale

Parallelism

Rush-FS uses multi-threaded parallelism for traversal operations:

APIconcurrency optionDefault
readdir (recursive)auto
glob4
rm (recursive)1
cp (recursive)1

Single-file operations (stat, readFile, writeFile, chmod, etc.) are atomic syscalls — parallelism does not apply.

Takeaway

Use Rush-FS when you have heavy recursive or batch I/O (readdir, glob, rm, cp). For single-file work it performs on par with Node.js; the napi bridge adds a fixed ~0.3 µs per call, which only matters for sub-microsecond operations like existsSync.

For more numbers (including cp thread scaling), see the README Benchmarks  section.

Last updated on