Time to walk linux's source tree on iMac (Retina 5K, 27-inch, Late 2015):

threadsjwalkignorewalkdir
unsorted854.631 ms70.848 ms-
sorted856.133 ms93.345 ms-
sorted, metadata886.985 ms122.08 ms-
sorted, first 10088.9931 ms--
unsorted288.416 ms108.97 ms-
unsorted1141.66 ms-134.28 ms
sorted1150.89 ms-170.24 ms
sorted, metadata1313.91 ms-310.26 ms

Notes

Comparing the performance of jwalk, ignore, and walkdir and how well they can use multiple threads.

Options:

  • “unsorted” means entries are returned in read_dir order.
  • “sorted” means entries are returned sorted by name.
  • “metadata” means filesystem metadata is loaded for each entry.
  • “first 100” means only first 100 entries are taken.