https://bugs.documentfoundation.org/show_bug.cgi?id=84635

--- Comment #15 from Aron Budea <[email protected]> ---
I looked at the 13-page document with current master build, and in:
void PaMCorrAbs( const SwPaM& rRange, const SwPosition& rNewPos )

there's this loop:
for(const auto& pWeakUnoCursor : pDoc->mvUnoCursorTable)
http://opengrok.libreoffice.org/xref/core/sw/source/core/doc/doccorr.cxx#124

pDoc->mvUnoCursorTable is an evergrowing table with mostly expired weak
references. If I put a breakpoint at the start of the loop, after a few
irregular increases, each time the debugger stops the size of mvUnoCursorTable
is shown to be increased by 5: ..., 22, 27, 32, 37, ..., 14012, ..., 53357,
..., 102312, ...

Each time only 4-5 references are valid in that vector. Function
cleanupUnoCursorTable(), which is supposed to remove expired references from
the vector is not called (though in this case it would be better to leave some
reserved space for further ones, the aforementioned function also shrinks the
vector).

Doing this before the for loop solves this particular issue, but it's likely
not the best place:
pDoc->mvUnoCursorTable.erase(
        std::remove_if(pDoc->mvUnoCursorTable.begin(),
pDoc->mvUnoCursorTable.end(), [](const std::weak_ptr<SwUnoCursor>& pWeakPtr) {
return pWeakPtr.expired(); }),
        pDoc->mvUnoCursorTable.end());

I assume this is only one of the multiple causes of the performance issue.
I also wonder why the status indicator is so... lively, and keeps filling up
again and again.

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to