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

            Bug ID: 102354
           Summary: Text auto-fit / de-composition - hyper expensive ...
           Product: LibreOffice
           Version: 5.1.5.2 release
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Impress
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: michael.me...@collabora.com

Some interesting performance problems with impress. Create a file with an
auto-fit text box containing two dozen rows of 'test Test Test test.' in a
smallish font size - say 6 point.

Now try to click into it to edit / select it. It takes an amazingly long time -
several seconds of hard work. No profile here, but typing 'finish' in gdb -
which shows some fun:

#37 0x00007f104a72c9d3 in GetTextEditBackgroundColor(SdrObjEditView const&) ()
from /opt/collaboraoffice5.1/program/libmergedlo.so

which returns just a color:

include/svx/svdetc.hxx:SVX_DLLPUBLIC Color GetTextEditBackgroundColor(const
SdrObjEditView& rView);

Appears to do a full de-composition of the shape, and worse re-auto-fits it as
we do it [ surely we do that just once when we first layout a shape ? ;-] it
appears to take 500ms for me in the debugger ( not scientific ).

Interesting trace here:

Thread 2 (Thread 0x7f1014f69700 (LWP 23816)):
#0  0x00007f10479974e0 in u_getCombiningClass_56 () from
/opt/collaboraoffice5.1/program/libicuuc.so.56
#1  0x00007f104bb0c21f in hb_icu_unicode_combining_class(hb_unicode_funcs_t*,
unsigned int, void*) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#2  0x00007f104bac5ea1 in hb_unicode_funcs_t::combining_class(unsigned int) ()
from /opt/collaboraoffice5.1/program/libmergedlo.so
#3  0x00007f104baf6538 in hb_unicode_funcs_t::modified_combining_class(unsigned
int) () from /opt/collaboraoffice5.1/program/libmergedlo.so
#4  0x00007f104baf412a in _hb_glyph_info_set_unicode_props(hb_glyph_info_t*,
hb_unicode_funcs_t*) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#5  0x00007f104baf4bb5 in hb_set_unicode_props(hb_buffer_t*) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#6  0x00007f104baf5f73 in hb_ot_shape_internal(hb_ot_shape_context_t*) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#7  0x00007f104baf6084 in _hb_ot_shape () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#8  0x00007f104bac432d in hb_shape_plan_execute () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#9  0x00007f104bac37e8 in hb_shape_full () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#10 0x00007f104bac3844 in hb_shape () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#11 0x00007f104b0c9112 in HbLayoutEngine::Layout(ServerFontLayout&,
ImplLayoutArgs&) () from /opt/collaboraoffice5.1/program/libmergedlo.so
#12 0x00007f104aef4793 in OutputDevice::ImplLayout(rtl::OUString const&, int,
int, Point const&, long, long const*, SalLayoutFlags, vcl::TextLayoutCache
const*) const () from /opt/collaboraoffice5.1/program/libmergedlo.so
#13 0x00007f104aef49e1 in OutputDevice::GetTextArray(rtl::OUString const&,
long*, int, int, vcl::TextLayoutCache const*) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#14 0x00007f104994c100 in SvxFont::QuickGetTextSize(OutputDevice const*,
rtl::OUString const&, int, int, long*) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#15 0x00007f104990ecbf in ImpEditEngine::CreateLines(int, unsigned int) () from
/opt/collaboraoffice5.1/program/libmergedlo.so

    slow to finish this ...

#16 0x00007f1049910b51 in ImpEditEngine::FormatDoc() () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#17 0x00007f1049914e44 in ImpEditEngine::FormatAndUpdate(EditView*) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#18 0x00007f10498d3f75 in EditEngine::SetUpdateMode(bool) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#19 0x00007f104a7b6ec5 in
SdrTextObj::impDecomposeAutoFitTextPrimitive(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
>&, drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D const&,
drawinglayer::geometry::ViewInformation2D const&) const
    () from /opt/collaboraoffice5.1/program/libmergedlo.so
#20 0x00007f104a6d34d0 in
drawinglayer::primitive2d::SdrAutoFitTextPrimitive2D::create2DDecomposition(drawinglayer::geometry::ViewInformation2D
const&) const () from /opt/collaboraoffice5.1/program/libmergedlo.so
#21 0x00007f1049805502 in
drawinglayer::primitive2d::BufferedDecompositionPrimitive2D::get2DDecomposition(drawinglayer::geometry::ViewInformation2D
const&) const () from /opt/collaboraoffice5.1/program/libmergedlo.so
---Type <return> to continue, or q <return> to quit---
#22 0x00007f104a6d2bec in
drawinglayer::primitive2d::SdrTextPrimitive2D::get2DDecomposition(drawinglayer::geometry::ViewInformation2D
const&) const () from /opt/collaboraoffice5.1/program/libmergedlo.so
#23 0x00007f10498066aa in
drawinglayer::primitive2d::BasePrimitive2D::getB2DRange(drawinglayer::geometry::ViewInformation2D
const&) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so

        slow to finish this ...

#24 0x00007f104980575a in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DReference(com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
const&, drawinglayer::geometry::ViewInformation2D const&) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#25 0x00007f10498058af in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
> const&, drawinglayer::geometry::ViewInformation2D const&) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#26 0x00007f10498066b8 in
drawinglayer::primitive2d::BasePrimitive2D::getB2DRange(drawinglayer::geometry::ViewInformation2D
const&) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#27 0x00007f104980575a in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DReference(com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
const&, drawinglayer::geometry::ViewInformation2D const&) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#28 0x00007f10498058af in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
> const&, drawinglayer::geometry::ViewInformation2D const&) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#29 0x00007f10498066b8 in
drawinglayer::primitive2d::BasePrimitive2D::getB2DRange(drawinglayer::geometry::ViewInformation2D
const&) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#30 0x00007f104980575a in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DReference(com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
const&, drawinglayer::geometry::ViewInformation2D const&) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#31 0x00007f10498058af in
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(com::sun::star::uno::Sequence<com::sun::star::uno::Reference<com::sun::star::graphic::XPrimitive2D>
> const&, drawinglayer::geometry::ViewInformation2D const&) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#32 0x00007f104a6bdda5 in
sdr::contact::ViewObjectContact::getPrimitive2DSequence(sdr::contact::DisplayInfo
const&) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#33 0x00007f104a6efafa in
ViewObjectContactPrimitiveHit(sdr::contact::ViewObjectContact const&,
basegfx::B2DPoint const&, double, bool) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#34 0x00007f104a6effc2 in SdrObjectPrimitiveHit(SdrObject const&, Point const&,
unsigned short, SdrPageView const&, SetOfByte const*, bool) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#35 0x00007f104a72c5a2 in (anonymous
namespace)::impGetSdrObjListFillColor(SdrObjList const&, Point const&,
SdrPageView const&, SetOfByte const&, Color&) () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#36 0x00007f104a72c61b in (anonymous namespace)::impGetSdrPageFillColor(SdrPage
const&, Point const&, SdrPageView const&, SetOfByte const&, Color&, bool) ()
from /opt/collaboraoffice5.1/program/libmergedlo.so
#37 0x00007f104a72c9d3 in GetTextEditBackgroundColor(SdrObjEditView const&) ()
from /opt/collaboraoffice5.1/program/libmergedlo.so

    Slow to finish from this [!] ...

#38 0x00007f104a726211 in SdrObjEditView::ImpMakeOutlinerView(vcl::Window*,
bool, OutlinerView*, SfxViewShell*) const ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#39 0x00007f104a729211 in SdrObjEditView::SdrBeginTextEdit(SdrObject*,
SdrPageView*, vcl::Window*, bool, SdrOutliner*, OutlinerView*, bool, bool,
bool) () from /opt/collaboraoffice5.1/program/libmergedlo.so
#40 0x00007f103084d348 in sd::View::SdrBeginTextEdit(SdrObject*, SdrPageView*,
vcl::Window*, bool, SdrOutliner*, OutlinerView*, bool, bool, bool)
    () from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#41 0x00007f103069caec in sd::FuText::SetInEditMode(MouseEvent const&, bool) ()
from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#42 0x00007f103069d30b in sd::FuText::DoExecute(SfxRequest&) () from
/opt/collaboraoffice5.1/program/../program/libsdlo.so
#43 0x00007f103082c261 in sd::DrawViewShell::FuPermanent(SfxRequest&) () from
/opt/collaboraoffice5.1/program/../program/libsdlo.so
#44 0x00007f1049f2cf08 in SfxDispatcher::Call_Impl(SfxShell&, SfxSlot const&,
SfxRequest&, bool) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#45 0x00007f1049f3489e in SfxDispatcher::Execute(unsigned short, SfxCallMode,
SfxPoolItem const*, ...) ()
   from /opt/collaboraoffice5.1/program/libmergedlo.so
#46 0x00007f1030696e0f in sd::FuSelection::MouseButtonDown(MouseEvent const&)
() from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#47 0x00007f103086a562 in sd::ViewShell::MouseButtonDown(MouseEvent const&,
sd::Window*) ()
   from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#48 0x00007f1030815a68 in sd::DrawViewShell::MouseButtonDown(MouseEvent const&,
sd::Window*) ()
   from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#49 0x00007f1030866f2d in sd::ViewShell::LogicMouseButtonDown(MouseEvent
const&) () from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#50 0x00007f10307860ed in SdXImpressDocument::postMouseEvent(int, int, int,
int, int, int) ()
   from /opt/collaboraoffice5.1/program/../program/libsdlo.so
#51 0x00007f104a1e67f9 in doc_postMouseEvent () from
/opt/collaboraoffice5.1/program/libmergedlo.so
#52 0x0000000000438d5c in postMouseEvent (this=<optimized out>,
nModifier=<optimized out>, nButtons=<optimized out>, nCount=<optimized out>, 
    nY=<optimized out>, nX=<optimized out>, nType=<optimized out>) at
LibreOfficeKit.hpp:252
#53 ChildSession::mouseEvent (this=this@entry=0x12dfc78, tokens=...) at
ChildSession.cpp:691
#54 0x0000000000442d68 in ChildSession::_handleInput (this=0x12dfc78, 
    buffer=0x7f100c000950 "mouse type=buttondown x=10864 y=7519 count=1
buttons=1 modifier=0", length=65) at ChildSession.cpp:231
#55 0x000000000044d7c2 in LOOLSession::handleInput (this=0x12dfc78, 
    buffer=0x7f100c000950 "mouse type=buttondown x=10864 y=7519 count=1
buttons=1 modifier=0", length=65) at LOOLSession.cpp:227
#56 0x0000000000423a34 in operator() (payload=..., __closure=<optimized out>)
at LOOLKit.cpp:326
#57 std::_Function_handler<bool (std::vector<char, std::allocator<char> >
const&), Connection::run()::{lambda(std::vector<char, std::allocator<char> >
const&)#1}>::_M_invoke(std::_Any_data const&, std::vector<char,
std::allocator<char> > const&) (__functor=..., __args#0=...)
    at /usr/include/c++/4.8/functional:2057
#58 0x00000000004448a9 in operator() (__args#0=..., this=0x7f1014f68c40) at
/usr/include/c++/4.8/functional:2471
#59 IoUtil::SocketProcessor(std::shared_ptr<Poco::Net::WebSocket> const&,
std::function<bool (std::vector<char, std::allocator<char> > const&)> const&,
std::function<void ()> const&, std::function<bool ()> const&) (ws=...,
handler=..., closeFrame=..., stopPredicate=...) at IoUtil.cpp:167
#60 0x000000000042c896 in Connection::run (this=0x12dfe68) at LOOLKit.cpp:335
#61 0x00007f104ef1de66 in Poco::ThreadImpl::runnableEntry (pThread=0x12dfe78)
at src/Thread_POSIX.cpp:349
#62 0x00007f104da550a4 in start_thread (arg=0x7f1014f69700) at
pthread_create.c:309
#63 0x00007f104d78acbd in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:111

Thanks ! =)

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

Reply via email to