[Kst] Re: Bug in ASCII fixed-width
Peter Kümmel
syntheticpp at gmx.net
Sat Feb 5 14:33:29 CET 2011
>> On a related note, I was wondering what happens if we indicate fixed-width but there are some characters missing at the end of the last column (like stripped whitespace). It should not crash, and if possible even read the results correctly. I haven't tried yet, so maybe it already works, but I see potential for problems there.
>
> For each number we calculate the position by starting at the beginning of the row by adding an offset:
> _rowIndex[i] + col_start
> so it is not important how long the last column is.
>
> But reading could we a bit faster if we have a constant row length,
> then we could use a constant integer in the loop which should be faster
> than looking up the index for the row start.
>
Here some numbers:
msvc : 0.51s -> 0.44s 15% faster
mingw: 0.71s -> 0.58s 22% faster
Maybe the numbers for gcc are better under Linux and I assume here the
results strongly depend of the optimization capabilities of the compiler.
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: row_length.patch
Type: text/x-patch
Size: 865 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kst/attachments/20110205/9efc081f/attachment.patch
More information about the Kst
mailing list