Open likern opened 6 years ago
Yes, this is a great idea and I'd love to do it one day! I've been thinking about this for a while, and I implemented something in the related vmprobe project: https://github.com/vmprobe/vmprobe/tree/master/libvmprobe
Unfortunately it's not really ready to get dropped into other projects yet.
What about creating library with convenient API? This gives:
My possible use case for this great tool: I'm creating photo manager. If USB-drive/disk is inserted I have to read all files and generate thumbnails for them. Nothing unusual to have at least 16/32/64GB disks. Reading this through slow USB will require lots of time. But what about if user already opened this USB recently, for example, through Nautilus (which will generate thumbnails also for all files in directory, thus reading them all). For that case huge amount of data will be already cached (in my experiment 4Gb of 6Gb folder were cached, reading 6Gb required 8 minutes). If I start reading other directory first, cached data most likely will be evicted!
But if I first will open and read cached images, and generate thumbnails for them (we use different caches for thumbnails) I will do that almost instantly and will not get cache misses. Great addition to UI responsiveness!