6 ms·
> If you use the standard bitmap icon formats, you’ll probably store them in their own files, separate from the files that use them. In order to display each fi
by tdeck 3y ago
> If you use the standard bitmap icon formats, you’ll probably store them in their own files, separate from the files that use them. In order to display each file in a folder, the operating system will need to read the metadata for the file (including its name and file type) and then read the icon file for that file type. If the icon file were so small that you could store it in the same place as the file metadata, then you could save a read from the hard drive – you could get the metadata and the icon all in one read.
> ... it could be a significant performance gain to halve the number of disk reads even if rendering a vector image takes longer than rendering a bitmap.
Surely another option would be to cache all the filetype icons in memory and thereby only read them once? You could still use this cool vector format and get the best of both worlds, so each icon would be small and would be read only once, and you wouldn't have duplicate icon data all over the disk. And then if you wanted to change the icon associated with a particular filetype, you wouldn't need to update every single inode for files of that type.