Re: Performance: Loading a large plain data file takes very long - solution proposal

Niklas Nebel <[email protected]>
Newsgroups gmane.comp.openoffice.devel.general
Message-ID <[email protected]>
On 12/04/10 15:24, Bartosz wrote:
> Loading a large plain data file takes very long.
> This problem was described at:
> http://wiki.services.openoffice.org/wiki/Calc/Performance/The_Ou_case
>
> Look at file:
> http://svn.services.openoffice.org/opengrok/xref/DEV300_m94/sc/source/filter/xml/xmlsubti.cxx
>
> 38% of time spent in ScMyTables::NewColumn() because of replicated use of aTableVec[nTableCount - 1] (vector::operator[])
>
> What do you think about instead using:
>      aTableVec[nTableCount - 1]
> use instead:
>      aTableVec.back()
>
> I think it could increase an perfomance slightly.

Did you measure if that makes a real difference?
Eike's suggestion on the wiki page is to reduce the number of operator[] 
calls by obtaining a pointer or reference once. That will probably help 
more.

Niklas
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.