making kioslave/trash size cache more robust

David Faure faure at kde.org
Tue Dec 18 15:06:47 GMT 2012


On Thursday 06 December 2012 12:17:08 Diggory Hardy wrote:
> So you're suggesting that we (or someone) should somehow bring all
> implementations in line with an updated spec? How would one go about doing
> this? My aim was to make what KDE does more robust in the face of differing
> implementations (as well as problems caused by non-atomic writes), although
> updating the spec at the same time sounds like a good idea.

No I didn't suggest fixing all implementations :-)

My suggestion was: 
1) subscribe to the xdg list
 http://lists.freedesktop.org/mailman/listinfo/xdg
2) post a proposal for a modified trash spec, ideally using the spec from git 
as reference for the patch:
git clone git://anongit.freedesktop.org/xdg/shared-mime-info

Thanks!

> I have no idea how file systems store these stats, though I imagine some
> implementations might require quite a few seeks to stat all the files.
> Since CPUs are pretty fast I don't think parsing would ever be worse than
> bad cases of stat-ing (e.g. several thousand items on a slow HDD), which is
> I presume the ones we're trying to optimise.

There are systems with slow disks and fast CPUs, and systems with fast disks 
(SSD) and slow (or busy) CPUs. Any tradeoff is difficult to decide on ... but if 
the alternative is to keep neither one busy, then that's obviously the better 
solution. Hence my idea of making implementations update a single line in a 
small file, that's got to be faster than anything that involves many files.

Anyway -- the 2nd solution, parsing many files means reading, i.e. stating and 
seeking too, in addition to the CPU, I'm pretty sure we don't want that.
You don't know what people have in the trash -- that's the point. If it's a 
ton of single files, this will be a lot slower than stat'ing, for sure.

> So, I'll wait for a bit more input before really starting. I'm a bit busy
> at the moment anyway.

Don't wait, get the discussion started on xdg :-)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Working on KDE, in particular KDE Frameworks 5





More information about the kde-core-devel mailing list