roadmap

What the review read and ran

An appendix to the release review of file_allocation_table.

The crate

partsfoundry/file_allocation_table at 77d47998705e05bf414cd82afcc969af5319795b, version 0.1.0-pre.3, edition 2024, rust-version 1.88. Read: Cargo.toml, README.md, CHANGELOG.md, src/lib.rs and every public module under src/. The lane read the tests and the Kani harnesses for their count and their subjects only. The clone stayed unchanged; git status printed nothing after every command.

The commands

All ran on a Linux x86_64 host (Intel Xeon Platinum 8160 at 2.10 GHz, 80 threads), rustc 1.100.0, with the target directory outside the clone.

The comparators read

The lane fetched each .crate from crates.io at the version in the prior-art table. Each went into its own empty directory before the lane unpacked and read it.

The benchmark

A scratch crate depends on this crate by path and on fatfs = "=0.3.6" with its default features, so it runs over std with alloc and chrono on. fatfs 0.3 has no sector cache, and its DirEntry::file_name (src/dir_entry.rs, line 512) returns a new String for each entry, which the list column calls. taskset -c 7 cargo run --release --bin fat_bench runs it pinned to one core.

Three runs pinned to one core, in nanoseconds, this crate first:

workload run 1 run 2 run 3
open the volume 60 / 170 62 / 153 61 / 154
open and read a 1 MiB file 76,123 / 80,516 74,300 / 81,735 73,648 / 83,489
open and list a 128-file directory 18,472 / 64,363 18,447 / 65,022 18,703 / 64,027

Seven unpinned runs on the shared host put the read at 76,269 to 79,744 against 82,468 to 89,823, and the listing at 18,684 to 29,551 against 64,246 to 93,890; both move with the host's load.

The create cost

Finding P2-7 will not be fixed. Each create reads the whole directory once: one pass refuses a clashing name, numbers the alias and finds the free slots. Remembering the first free run would save no reads, since a directory that fills from the front has it at the end marker. In a release build on a Linux x86_64 host, the 1,000th, 2,000th and 4,000th 8.3 creates in the root of a 128 MiB FAT32 volume of one-sector clusters read 65, 127 and 253 sectors. The crate README's BUGS section states the cost.

What was not run