SquashFS is documented in some detail in the kernel documentation. All the contents of a SquashFS file system can be compressed, including inodes and directory entries; inodes and directory entries are also laid out specifically to improve compression.
This means that any data or metadata read from the file system involves decompression; however, the overhead is reduced somewhat using caches:
* file data is decompressed to the page cache, so multiple reads in the same page don’t require decompressing the data multiple times;
* metadata and fragments (tail-end packed blocks) are decompressed to small, specific metadata and fragment caches, so multiple reads of the same metadata blocks ( _e.g._ when listing a directory’s contents) don’t require decompressing the same blocks multiple times.
There are also various lookup tables to speed up operations involving various indexes (blocks, user and group identifiers, and fragments).