bring speed back into KConfig

Dirk Mueller mueller at kde.org
Fri Apr 18 01:48:24 CEST 2008


On Friday 18 April 2008, Jakub Stachowski wrote:

> I did some more optimizing to  minimize copying data around. Instead of
> using QByteArray everywhere I added class BufferFragment with very similar
> (bare minimum used by parser) API, but operating on allocated earlier big
> buffer. like left(), trim(), mid(), etc. are only pointer and int
> operations.

Very nice approach, I like it. I haven't read the patch in detail, but 
browsing over it I think it does the right thing. I have a couple of small 
additions however: 

a) the readall() might kill the app if its a really big config file. can you 
add some "chunking" so that it perhaps reads only 128kb or something like 
that at a time, even if its a really big kconfig file?

b) the methods do need clear documentation about the expected state and 
calling convention, to make the patch easier to review. 

c) please don't add an implicit QByteArray() operator.. add a toByteArray() 
function and place the conversion explicitely in the code, so that it is 
clear when the "slow" conversion is happening. 

Again, many thanks for putting time into it. Great work!

Greetings,
Dirk


More information about the Kde-optimize mailing list