KIO directory listing - CPU slows down SSD

David Faure faure at kde.org
Wed May 28 07:59:48 UTC 2014


On Wednesday 14 May 2014 12:50:18 Aaron J. Seigo wrote:
> * one entry at a time, serialized
> * no changing data once put there
> * no getting the data back out
> 
> the class would then just batch up data into its QByteArray and then shunt
> it  across the wire when needed. no middle men, no 100s of 1000s of objects
> and QLists and << operators. just an API sth like:
> 
>         startEntry
>         addField
>         endEntry

I like this idea very much. Mark: see, it's quite close to what we were 
discussing by email recently. And I hadn't read this yet :)

Note how this is not specific to the ioslave using QT_STATBUFF :)

> internally it could either batch up the fields and then stream them out
> when  endEntry is called, or (and this is what i would do personally) on
> startEntry it would set up the header but with bad data (e.g. field count
> of 0) and then start appending the fields as they come in and increment a
> field count variable. when endEntry is called, update the header with the 
> right field count.

Ah but batching requires a vector again. Or you meant writing into a bytearray 
and coming back to update the count - that would rely on QDataStream internals 
I'm afraid (how to know the offset....).

But the alternative is to replace the field count with an "end of fields" 
special field.

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



More information about the Kde-frameworks-devel mailing list