[Kst] branches/work/kst/portto4/kst/src/datasources/ascii

Peter Kümmel syntheticpp at gmx.net
Sun Sep 5 19:36:37 CEST 2010


Am Sonntag, den 05.09.2010, 00:28 +0200 schrieb nicolas.brisset at free.fr:
> Hi Peter, 
> 
> let me guess: the weather is not better in Berlin than in Munich today. It seems you've been pretty active :-)

The summer is over :(

> Speaking about speed in the ASCII datasource, I haven't looked at the code since you changed it recently but if I remember it correctly in the past we allocated memory in chunks of a fixed size, meaning that if there was a very large amount of data we would do a lot of reallocs. I suspect this is not great performance-wise. I was thinking about a trick that may be helpful: ASCII files should have a size that grows more or less proportionnally with the number of lines, hence samples. That means that when we've read a couple of lines and know the file size, we should be able to determine the number of samples with a fairly good accuracy and realloc directly the right amount of memory.
> I don't know how much that would help for performance and if it still makes sense with today's code, but I thought it was worth mentioning.

We already use statically allocated memory for the buffers and when the
vector is read the caller allocates the memory once. And I assume
reading from file is much slower than a 'new'. But the only reliable
information could give a profiler.

> 
> Thanks for the plot drag&drop stuff, I'll test it and let you know what I think about it.

Looking forward to your opinion.

Peter

> 
> Cheers,
> 
> Nicolas
> > SVN commit 1171627 by kuemmel:
> > 
> > Faster loading in debug mode: disable asserts in debug mode
> > 
> >  M  +43 -24    asciisource.cpp  
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst




More information about the Kst mailing list