From a quick test, about 5x faster:
tavianator@tachyon $ cat bench.mjs
#!/usr/bin/env node
import { fdir } from "fdir";
console.log(new fdir().withFullPaths().crawl("/home/tavianator/code/android").sync().length);
tavianator@tachyon $ hyperfine -w1 "node ./bench.mjs" "bfs ~/code/android -false"
Benchmark 1: node ./bench.mjs
Time (mean ± σ): 2.073 s ± 0.031 s [User: 1.372 s, System: 1.260 s]
Range (min … max): 2.022 s … 2.128 s 10 runs
Benchmark 2: bfs ~/code/android -false
Time (mean ± σ): 417.5 ms ± 6.8 ms [User: 592.3 ms, System: 2487.7 ms]
Range (min … max): 405.2 ms … 429.7 ms 10 runs
Summary
bfs ~/code/android -false ran
4.97 ± 0.11 times faster than node ./bench.mjs
Is there a way to call it that doesn't require holding all the paths in memory simultaneously?