[Kst] Re: AsciiSource: new defaults, Kst's atof
Peter Kümmel
syntheticpp at gmx.net
Wed Jan 26 10:02:11 CET 2011
On 25.01.2011 17:51, Peter Kümmel wrote:
>> Is the proposal to have '#' as the default comment delimiter? The speedup
>> is from only having one?
>
> Yes, having four slow it down:
>
> internal update:
> 1 char -> 2.3s
> 4 char -> 12s
>
> loading data:
> 1 char -> 3.6s
> 4 char -> 10.1s
>
> For 4 charackter QString::contains is called when only one char is used
> only a char==char is done., therefore the speedup.
>
> But we could introduce optimized functions for the cases n < 5 if necessary.
>
I've optimized it for n <= 6.
Now we have:
> internal update:
1 char -> 2.3s
4 char -> 12.0s (old)
4 char -> 4.6s (optimized)
loading data:
1 char -> 3.6s
4 char -> 10.1s (old)
4 char -> 4.6s (optimized)
Having this times it would also be a compromise to use the old default delimiters, but
only having '#' is still much faster.
Peter
More information about the Kst
mailing list