Issue 117844

Summary: Docx import of a specific document took long time over 2 minutes
Product: Writer Reporter: dyo
Component: open-importAssignee: AOO issues mailing list <issues>
Status: CONFIRMED --- QA Contact:
Severity: Normal    
Priority: P2 CC: eric.savary, issues, marcus, Mathias_Bauer, mdxonefour, mst.ooo
Version: 3.4.0 Beta (OOo)Keywords: usability
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Docx file received by Email (created with MS-Office 2007 ) none

Description dyo 2011-04-14 09:52:26 UTC
Created attachment 76380 [details]
Docx file received by Email (created with MS-Office 2007 ) 

When importing the attached Microsoft docx document it take a very long time (over 2 minutes) on a Solaris environment (also reproducible on MS-Windows).

There were an Oracle SR (SR 3-2940991681) before because the same document make a crash of OOO 3.3.
In Beta 000 3.4 the document need more than 2 minutes to open.
Comment 1 eric.savary 2011-04-14 10:44:36 UTC
@hbrinkm: Reproduced on Vista too. the document contents a lot of changes tracking.
Comment 2 Marcus 2011-04-15 11:57:04 UTC
@hbrinkm:
please evaluate in the context of 3.4
Comment 3 openoffice 2011-04-15 12:41:33 UTC
Analysis: Heaviest stack found by Instruments:

  45 libwriterfiltermxi.dylib  35894  WriterFilter::filter(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/filter/ImportFilter.cxx:123
  44 libwriterfiltermxi.dylib  35883  writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:353
  43 fastsax.uno.dylib  35877  sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&)
  42 fastsax.uno.dylib  35877  sax_fastparser::FastSaxParser::parse()
  41 fastsax.uno.dylib  35877  XML_ParseBuffer
  40 fastsax.uno.dylib  35864  contentProcessor
  39 fastsax.uno.dylib  37746  doContent
  38 fastsax.uno.dylib  26977  sax_fastparser::FastSaxParser::callbackEndElement(char const*)
  37 libwriterfiltermxi.dylib  26973  writerfilter::ooxml::OOXMLFastContextHandler::endFastElement(long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:240
  36 libwriterfiltermxi.dylib  26740  writerfilter::ooxml::OOXMLFastContextHandlerProperties::lcl_endFastElement(long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1274
  35 libwriterfiltermxi.dylib  26738  writerfilter::ooxml::OOXMLFastContextHandler::endAction(long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:395
  34 libwriterfiltermxi.dylib  26738  writerfilter::ooxml::OOXMLFastContextHandler::lcl_endAction(long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:399
  33 libwriterfiltermxi.dylib  26738  writerfilter::ooxml::OOXMLFactory::endAction(writerfilter::ooxml::OOXMLFastContextHandler*, long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFactory.cxx:334
  32 libwriterfiltermxi.dylib  26738  writerfilter::ooxml::OOXMLFactory_wml::endAction(writerfilter::ooxml::OOXMLFastContextHandler*) ../../unxmacxi/misc/OOXMLFactory_wml.cxx:4503
  31 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLFastContextHandlerProperties::handleXNotes() /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1321
  30 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLPropertySetImpl::resolve(writerfilter::Properties&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx:442
  29 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLPropertyImpl::resolve(writerfilter::Properties&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLPropertySetImpl.cxx:186
  28 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLFootnoteHandler::attribute(unsigned long, writerfilter::Value&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/Handler.cxx:53
  27 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLFastContextHandler::resolveFootnote(rtl::OUString const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1059
  26 libwriterfiltermxi.dylib  26515  writerfilter::ooxml::OOXMLDocumentImpl::resolveFootnote(writerfilter::Stream&, unsigned long const&, rtl::OUString const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:186
  25 libwriterfiltermxi.dylib  26495  writerfilter::ooxml::OOXMLDocumentImpl::resolveFastSubStreamWithId(writerfilter::Stream&, boost::shared_ptr<writerfilter::Reference<writerfilter::Stream> >, unsigned long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:106
  24 libwriterfiltermxi.dylib  26495  writerfilter::LoggedStream::substream(unsigned long, boost::shared_ptr<writerfilter::Reference<writerfilter::Stream> >) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/resourcemodel/LoggedResources.cxx:241
  23 libwriterfiltermxi.dylib  26495  writerfilter::dmapper::DomainMapper::lcl_substream(unsigned long, boost::shared_ptr<writerfilter::Reference<writerfilter::Stream> >) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/dmapper/DomainMapper.cxx:4642
  22 libwriterfiltermxi.dylib  25973  writerfilter::ooxml::OOXMLDocumentImpl::resolve(writerfilter::Stream&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx:353
  21 fastsax.uno.dylib  25973  sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&)
  20 fastsax.uno.dylib  25973  sax_fastparser::FastSaxParser::parse()
  19 fastsax.uno.dylib  25969  XML_ParseBuffer
  18 fastsax.uno.dylib  25435  contentProcessor
  17 fastsax.uno.dylib  25434  doContent
  16 fastsax.uno.dylib  15204  sax_fastparser::FastSaxParser::callbackCharacters(char const*, int)
  15 libwriterfiltermxi.dylib  15202  writerfilter::ooxml::OOXMLFastContextHandler::characters(rtl::OUString const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:324
  14 libwriterfiltermxi.dylib  15202  writerfilter::ooxml::OOXMLFastContextHandlerStream::lcl_characters(rtl::OUString const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:1250
  13 libwriterfiltermxi.dylib  15201  writerfilter::ooxml::OOXMLFastContextHandler::text(rtl::OUString const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx:846
  12 libwriterfiltermxi.dylib  15201  writerfilter::LoggedStream::utext(unsigned char const*, unsigned long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/resourcemodel/LoggedResources.cxx:205
  11 libwriterfiltermxi.dylib  15201  writerfilter::dmapper::DomainMapper::lcl_utext(unsigned char const*, unsigned long) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/dmapper/DomainMapper.cxx:4506
  10 libwriterfiltermxi.dylib  15201  writerfilter::dmapper::DomainMapper_Impl::appendTextPortion(rtl::OUString const&, boost::shared_ptr<writerfilter::dmapper::PropertyMap>) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/dmapper/DomainMapper_Impl.cxx:927
   9 libwriterfiltermxi.dylib  15187  writerfilter::dmapper::DomainMapper_Impl::CheckRedline(com::sun::star::uno::Reference<com::sun::star::text::XTextRange>) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/dmapper/DomainMapper_Impl.cxx:1225
   8 libwriterfiltermxi.dylib  15176  writerfilter::dmapper::DomainMapper_Impl::CreateRedline(com::sun::star::uno::Reference<com::sun::star::text::XTextRange>, boost::shared_ptr<writerfilter::dmapper::RedlineParams>&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/writerfilter/source/dmapper/DomainMapper_Impl.cxx:1199
   7 libswmxi.dylib  15095  SwXTextRange::makeRedline(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/unocore/unoobj2.cxx:1555
   6 libswmxi.dylib  15048  SwUnoCursorHelper::makeRedline(SwPaM&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/unocore/unocrsrhelper.cxx:1105
   5 libswmxi.dylib  15798  SwDoc::AppendRedline(SwRedline*, bool) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/doc/docredln.cxx:308
   4 libswmxi.dylib   7784  lcl_CheckRedline(SwDoc const*) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/doc/docredln.cxx:110
   3 libswmxi.dylib   4535  lcl_CheckPam(SwPaM const*) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/doc/docredln.cxx:96
   2 libswmxi.dylib   3964  lcl_CheckPosition(SwPosition const*) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/doc/docredln.cxx:78
   1 libswmxi.dylib   1756  SwIndex::Assign(SwIndexReg*, unsigned short) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/bastyp/index.cxx:310
   0 libswmxi.dylib   1810  SwIndex::ChgValue(SwIndex const&, unsigned short) /Volumes/data/OOo_Thunderbird/sw34bf06/Source/sw/source/core/bastyp/index.cxx:133
Comment 4 mst.ooo 2011-04-27 15:43:53 UTC
as i would have expected, there is SwDoc::AppendRedline on the stack.
AppendRedline has quadratic complexity, and that is just from the
theoretical point of view, in practice it's also a huge mess.

imho, improving the performance of AppendRedline is definitely far too risky
for a 3.4 target.
Comment 5 Oliver-Rainer Wittmann 2012-06-13 12:30:52 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.
Comment 6 Marcus 2017-05-20 11:13:40 UTC
Reset assigne to the default "issues@openoffice.apache.org".