KDirModelV2, KDirListerV2 and UDSEntryV2 suggestions

Alexander Neundorf neundorf at kde.org
Tue Feb 5 17:05:47 UTC 2013


On Tuesday 05 February 2013, Mark wrote:
> On Tue, Feb 5, 2013 at 11:47 AM, David Faure <faure+bluesystems at kde.org> 
wrote:
...
> > Total estimated memory usage for QUrl("file:///home/mark/a000000.txt"):
> > in Qt4: 345 bytes, plus d pointer = 353 bytes.
> > in Qt5: 206 bytes, plus d pointer = 214 bytes.
> > 
> > You were way understimating this, with "48 bytes" :)
> 
> Pff, you can say that again. I wasn't expecting that much
> "bookkeeping" for just one url to occur.. Very interesting stuff!
> 
> >> If we multiple that by 500.000 we get:
> >> 48 * 500.000 = 24000000 bytes (22.8 MB)
> > 
> > 353 * 500000 = 176500000 = 168.3 MB
> 
> so much! That has to be lowered. It just doesn't seem to be ok to
> expand the size of a dataset from ~20MB to ~160MB .. That's an 8to1
> ratio.

The 48 is really a wrong assumption, you should at the very least consider 
unicode, a size field and the pointer, which makes it 2*29 +8 +4=70 byte:
70 * 500.000 = 33.4 MB
Then we are still at 5 to 1.

> I wonder how much CPU overhead you would get if you calculate
> everything "when needed" and not store it. 

Nowadays often recalculating something when needed can be faster than getting 
it from memory, at least if the data is big enough so that it doesn't fit into 
the cache anymore (which is the case in your example).

...
> > Another possible conclusion: who in their right mind puts 500.000 files
> > in a directory? :-)

I know more or less nothing about Plasma Active, but when they say, they hide 
the filesystem hierarchy from the user, does that mean on disk everything will 
be in one directory ?

Alex


More information about the Kde-frameworks-devel mailing list