Sorter is currently slow because it calls the command line tools thousands of times while analyzing a full disk image. A C/C++ version would be much faster because it could use the C library and the overhead associated with opening a disk image would occur only once.