Bug 58613 - synchronous, no-progress-bar word-count on load before rendering ...
Summary: synchronous, no-progress-bar word-count on load before rendering ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.0.0.0.beta2
Hardware: Other All
: medium major
Assignee: Michael Meeks
URL:
Whiteboard: target:4.1.0 target:4.0.1
Keywords: perf, regression
Depends on:
Blocks:
 
Reported: 2012-12-21 11:56 UTC by Michael Meeks
Modified: 2015-12-15 11:35 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Meeks 2012-12-21 11:56:00 UTC
It seems that a chunk of our apparent performance regression on loading documents: .doc, .rtf, .docx and even some .odt I guess is down to the status-bar widget doing a synchronous word-count after load:

(gdb) bt
#0  SwDoc::UpdateDocStat (this=0x8ba2270) at /ssd/opt/libreoffice/master/sw/source/core/doc/doc.cxx:1689
#1  0xb0a495ce in SwDoc::GetUpdatedDocStat (this=0x8ba2270) at /ssd/opt/libreoffice/master/sw/source/core/doc/doc.cxx:1162
#2  0xb0f132af in SwView::StateStatusLine (this=0x92b0820, rSet=...) at /ssd/opt/libreoffice/master/sw/source/ui/uiview/view2.cxx:1244
#3  0xb0f0fa52 in SfxStubSwViewStateStatusLine (pShell=0x92b0820, rSet=...)
    at /ssd/opt/libreoffice/master/workdir/unxlngi6.pro/SdiTarget/sw/sdi/swslots.hxx:12007
#4  0xb7800a8b in CallState (rSet=..., pFunc=<optimized out>, this=0x92b0820) at /ssd/opt/libreoffice/master/sfx2/inc/sfx2/shell.hxx:190
#5  SfxShell::GetSlotState (this=0x92b0820, nSlotId=21189, pIF=<optimized out>, pStateSet=0x0)
    at /ssd/opt/libreoffice/master/sfx2/source/control/shell.cxx:920
#6  0xb7944612 in SfxDispatcher::QueryState (this=0x92acb98, nSID=21189, rAny=empty uno::Any)
    at /ssd/opt/libreoffice/master/sfx2/source/control/dispatch.cxx:2247
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'svt::StatusbarController': 
#7  0xb7813de9 in SfxDispatchController_Impl::addStatusListener (this=0x95f83d0, aListener=, aURL=...)
    at /ssd/opt/libreoffice/master/sfx2/source/control/unoctitm.cxx:812
#8  0xb7537096 in svt::StatusbarController::bindListener (this=0x95ead68)
    at /ssd/opt/libreoffice/master/svtools/source/uno/statusbarcontroller.cxx:477
#9  0xb75373ce in svt::StatusbarController::update (this=0x95ead68) at /ssd/opt/libreoffice/master/svtools/source/uno/statusbarcontroller.cxx:175
#10 0xb1521396 in framework::StatusBarManager::UpdateControllers (this=0x95c87a8)
    at /ssd/opt/libreoffice/master/framework/source/uielement/statusbarmanager.cxx:283
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'framework::ConstItemContainer': 
#11 0xb15237ea in framework::StatusBarManager::FillStatusBar (this=0x95c87a8, rItemContainer=)
    at /ssd/opt/libreoffice/master/framework/source/uielement/statusbarmanager.cxx:513
Python Exception <class 'gdb.error'> There is no member named _pSequence.: 
Python Exception <class 'gdb.error'> There is no member named _pSequence.: 
#12 0xb15244e2 in framework::StatusBarWrapper::initialize (this=0x95c8388, aArguments=)
    at /ssd/opt/libreoffice/master/framework/source/uielement/statusbarwrapper.cxx:129
#13 0xb153b9dc in framework::MenuBarFactory::CreateUIElement (ResourceURL="private:resource/statusbar/statusbar", 
...
#20 0xb77e3f28 in SfxWorkWindow::UpdateStatusBar_Impl (this=0x92ade60) at /ssd/opt/libreoffice/master/sfx2/source/appl/workwin.cxx:1645
#21 0xb77e521f in SfxWorkWindow::UpdateObjectBars_Impl (this=0x92ade60) at /ssd/opt/libreoffice/master/sfx2/source/appl/workwin.cxx:1401
#22 0xb77e5374 in UpdateObjectBars_Impl (this=0x92ade60) at /ssd/opt/libreoffice/master/sfx2/source/appl/workwin.cxx:1233
#23 SfxFrameWorkWin_Impl::UpdateObjectBars_Impl (this=0x92ade60) at /ssd/opt/libreoffice/master/sfx2/source/appl/workwin.cxx:1221
#24 0xb7942497 in SfxDispatcher::Update_Impl (this=0x92acb98, bForce=0 '\000')
    at /ssd/opt/libreoffice/master/sfx2/source/control/dispatch.cxx:1375
#25 0xb79250e6 in SfxBaseController::ConnectSfxFrame_Impl (this=0x92b4bb8, i_eConnect=SfxBaseController::E_CONNECT)
---Type <return> to continue, or q <return> to quit---
    at /ssd/opt/libreoffice/master/sfx2/source/view/sfxbasecontroller.cxx:1330
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'framework::Frame': 
#26 0xb7928468 in SfxBaseController::attachFrame (this=0x92b4bb8, xFrame=)
    at /ssd/opt/libreoffice/master/sfx2/source/view/sfxbasecontroller.cxx:587
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'SwXTextDocument': 
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'framework::Frame': 
#27 0xb791d656 in SfxFrameLoader_Impl::impl_createDocumentView (this=0x8b356c8, i_rModel=, i_rFrame=, i_rViewFactoryArgs=..., 
    i_rViewName="Default") at /ssd/opt/libreoffice/master/sfx2/source/view/frmload.cxx:503
Python Exception <class 'gdb.error'> base class 'com::sun::star::uno::XInterface' is ambiguous in type 'framework::Frame': 
#28 0xb791e049 in SfxFrameLoader_Impl::load (this=0x8b356c8, rArgs=uno::Sequence of length 11 = {...}, _rTargetFrame=)
    at /ssd/opt/libreoffice/master/sfx2/source/view/frmload.cxx:620
#29 0xb14a033f in framework::LoadEnv::impl_loadContent (this=0x89c915c) at /ssd/opt/libreoffice/master/framework/source/loadenv/loadenv.cxx:1150
#30 0xb14a114d in framework::LoadEnv::startLoading (this=0x89c915c) at /ssd/opt/libreoffice/master/framework/source/loadenv/loadenv.cxx:398
#31 0xb145c330 in framework::LoadDispatcher::impl_dispatch (this=0x89c9110, rURL=..., lArguments=uno::Sequence of length 4 = {...}, 
    xListener=empty uno::Reference) at /ssd/opt/libreoffice/master/framework/source/dispatch/loaddispatcher.cxx:119
#32 0xb145c69b in framework::LoadDispatcher::dispatchWithReturnValue (this=0x89c9110, rURL=..., lArguments=uno::Sequence of length 4 = {...})
    at /ssd/opt/libreoffice/master/framework/source/dispatch/loaddispatcher.cxx:65
...

Which is really rather non-ideal.

I guess it would almost certainly be better to do the word-count at idle in chunks of thousand nodes or whatever. All the mechanisms for doing that should (presumably) exist somewhere. Perhaps I'll look into that.
Comment 1 Michael Meeks 2012-12-21 13:27:42 UTC
I guess we need to add / propagate a flag 'bool bAsyncUpdate' or something to there, such that we can immediately exit / bail-out if there is a large document and start an idle/timeout handler to finish ensuring that all the nodes are fully marked word-count-clean I guess.
Comment 2 Michael Meeks 2012-12-21 13:28:01 UTC
Regression from 3.4 which didn't have the word-count status-bar I guess.
Comment 3 Michael Stahl (allotropia) 2013-03-22 22:49:54 UTC
dear reporter, somebody apparently fixed your bug on master:

commit a128bea5dda1d74426dae62b032d5af52f431fe2
Author: Michael Meeks <michael.meeks@suse.com>
Date:   Wed Feb 13 16:04:01 2013 +0000

    cancel asynchronous word-count on sync. word-count.

commit c138a8aec8dccb97948a7d7993e6869da4079b32
Author: Michael Meeks <michael.meeks@suse.com>
Date:   Wed Feb 13 11:35:13 2013 +0000

    asynchronous word-count.

was also backported to libreoffice-4-0, although without cherry-pick -x and no ChangeId:

commit 6dbc7fdd094b3c29de0932c4ea3afc1a5a10d7fc
Author: Michael Meeks <michael.meeks@suse.com>
Date:   Wed Feb 13 11:35:13 2013 +0000

    asynchronous word-count.
Comment 4 Robinson Tryon (qubit) 2015-12-15 11:35:59 UTC
Migrating Whiteboard tags to Keywords: (perf)
[NinjaEdit]