Issue 125055 - Opening some documents is much slower in AOO 4.1
Summary: Opening some documents is much slower in AOO 4.1
Status: VERIFIED FIXED
Alias: None
Product: Writer
Classification: Application
Component: ui (show other issues)
Version: 4.1.0
Hardware: All All
: P3 Normal (vote)
Target Milestone: 4.1.1
Assignee: Oliver-Rainer Wittmann
QA Contact: Rekha S
URL:
Keywords: performance, regression
Depends on:
Blocks: 124985
  Show dependency treegraph
 
Reported: 2014-06-05 18:53 UTC by Joe Smith
Modified: 2014-07-18 15:36 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 4.1.1_release_blocker+


Attachments
kcachegrind displaying callgrind data (207.17 KB, image/png)
2014-06-05 20:44 UTC, Ariel Constenla-Haile
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Joe Smith 2014-06-05 18:53:51 UTC
Something has changed in AOO 4.1 that makes opening documents several times slower than 4.0.1.

For smaller documents, this isn't much of a problem; for larger documents with lots of bookmarks, it's more serious.

For example, opening the ODF spec
http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.odt

AOO 4.0.1:  46s
AOO 4.1    362s

In my own document, the problem seems to be associated with bookmarks: the more bookmarks there are, the slower the document loads. Removing all the bookmarks produces a document that loads as fast as with 4.0.1.

But this is not true for the ODF spec. Removing the bookmarks has no obvious effect on the load time.

Again, the slowness is something new in AOO 4.1.
Comment 1 Ariel Constenla-Haile 2014-06-05 19:18:26 UTC
(In reply to Joe Smith from comment #0)
> http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.odt

Reproducible on my Linux box:

AOO 4.0.1:  15s
AOO 4.1    158s
Comment 2 Ariel Constenla-Haile 2014-06-05 20:37:10 UTC
This might be introduced by fixes for bug 124338 in Revision 1574113

(In reply to Joe Smith from comment #0)
> In my own document, the problem seems to be associated with bookmarks: the
> more bookmarks there are, the slower the document loads. Removing all the
> bookmarks produces a document that loads as fast as with 4.0.1.
> 
> But this is not true for the ODF spec. Removing the bookmarks has no obvious
> effect on the load time.

In this one, it seems related to references.
Comment 3 Ariel Constenla-Haile 2014-06-05 20:44:24 UTC
Created attachment 83503 [details]
kcachegrind displaying callgrind data

Didn't have the patience to run AOO withing callgrind until the ODF spec. finished loading, but a backtrace in the middle while the document was half loaded gives some indications (attached is only a screenshot of KCachegrind, because the callgrind raw data is ca. 25 MB):

callgrind_control -b
PID 16683: /home/ariel/aoo/installation/openoffice4/program/soffice.bin /tmp/OpenDocument-v1.2-os-part1.odt
sending command status internal to pid 16683

  Frame: Backtrace for Thread 1
   [ 0]  SwPosition::operator<(SwPosition const&) const (616228149 x)
   [ 1]  (anonymous namespace)::lcl_MarkOrderingByStart(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&) (236034848 x)
   [ 2]  void std::__introsort_loop<__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, long, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)>(__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, __gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, long, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)) (247041 x)
   [ 3]  void std::__introsort_loop<__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, long, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)>(__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, __gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, long, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)) (131775 x)
   [ 4]  void std::sort<__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)>(__gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, __gnu_cxx::__normal_iterator<boost::shared_ptr<sw::mark::IMark>*, std::vector<boost::shared_ptr<sw::mark::IMark>, std::allocator<boost::shared_ptr<sw::mark::IMark> > > >, bool (*)(boost::shared_ptr<sw::mark::IMark> const&, boost::shared_ptr<sw::mark::IMark> const&)) (44892 x)
   [ 5]  sw::mark::MarkManager::sortSubsetMarks() (44892 x)
   [ 6]  sw::mark::MarkManager::sortMarks() (44892 x)
   [ 7]  sw::mark::MarkManager::assureSortedMarkContainers() const (44892 x)
   [ 8]  SwTxtNode::Update(SwIndex const&, unsigned short, bool, bool) (81761 x)
   [ 9]  SwTxtNode::InsertText(String const&, SwIndex const&, IDocumentContentOperations::InsertFlags) (72494 x)
   [10]  SwDoc::InsertString(SwPaM const&, String const&, IDocumentContentOperations::InsertFlags) (72440 x)
   [11]  SwUnoCursorHelper::DocInsertStringSplitCR(SwDoc&, SwPaM const&, String const&, bool) (72440 x)
   [12]  SwXText::insertString(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&, rtl::OUString const&, unsigned char) (72446 x)
   [13]  non-virtual thunk to SwXText::insertString(com::sun::star::uno::Reference<com::sun::star::text::XTextRange> const&, rtl::OUString const&, unsigned char) (69594 x)
   [14]  XMLTextImportHelper::InsertString(rtl::OUString const&, unsigned char&) (30043 x)
   [15]  XMLParaContext::Characters(rtl::OUString const&) (30043 x)
   [16]  SvXMLImport::characters(rtl::OUString const&) (80618 x)
   [17]  non-virtual thunk to SvXMLImport::characters(rtl::OUString const&) (80618 x)
   [18]  sax_expatwrap::SaxExpatParser_Impl::callbackCharacters(void*, unsigned short const*, int) (82616 x)
Comment 4 Oliver-Rainer Wittmann 2014-06-06 09:11:51 UTC
taking over to have a closer look.

Kudos to Ariel for the detailed analysis.
Comment 5 Oliver Brinzing 2014-06-06 10:51:50 UTC
.
Comment 6 Oliver-Rainer Wittmann 2014-06-13 14:30:10 UTC
requesting release blocking flag as this performance decrease is serious.

I am working on a solution.
Comment 7 jsc 2014-06-16 08:43:03 UTC
grant showstopper flag because it is a regression
Comment 8 SVN Robot 2014-06-16 08:43:52 UTC
"orw" committed SVN revision 1602823 into trunk:
125055: follow-up of fix for issue 124338 - adjust condition to trigger sort ...
Comment 9 Oliver-Rainer Wittmann 2014-06-16 08:46:38 UTC
fixed on trunk - merge to branch AOO410 will follow.
Comment 10 SVN Robot 2014-06-16 10:01:56 UTC
"orw" committed SVN revision 1602833 into branches/AOO410:
125055: follow-up of fix for issue 124338 - adjust condition to trigger sort ...
Comment 11 Oliver-Rainer Wittmann 2014-06-16 11:06:16 UTC
fixed on branch AOO410 for planned 4.1.1 release
Comment 12 fanyuzhen 2014-07-01 06:31:01 UTC
Rekha, could you please verify this bug? Thanks!
Comment 13 Rekha S 2014-07-10 04:56:23 UTC
Verified this bug on AOO 4.1.1 Windows 8 OS on

http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.odt

Time taken to open the  doc : 52 sec.

There seems to be considerable progress in the time taken now .


Thanks!
Rekha
Comment 14 Joe Smith 2014-07-18 15:36:52 UTC
Tested OpenOffice 4.1.1  411m2(Build:9771) on Fedora Linux

Opening both my document and the ODF spec are now as fast as with AOO 4.0.1.

So nice--Thanks!