Apache OpenOffice (AOO) Bugzilla – Issue 102671
chart2: pie chart re-sizing ...
Last modified: 2013-02-24 21:21:53 UTC
I created a pie chart for the attached data range; it took a little while to render (fair enough, there is a lot of data) - and produced a beautiful result. Sadly after a cut/paste to move it to the top of the sheet, as I re-sized it to double the size, we hit some N^2 in the number of data-points (I suspect) - and everything went away ;-) [ holding the mouse grab too worse luck ]. (gdb) bt #0 0xb7d1a8ba in _int_malloc (av=0xb7e05140, bytes=8) at malloc.c:4367 #1 0xb7d1c88c in *__GI___libc_malloc (bytes=8) at malloc.c:3551 #2 0xb7fade01 in rtl_allocateMemory () from /usr/lib/ooo3/program/../basis-link/ure-link/lib/libuno_sal.so.3 #3 0xb7aa9861 in cppu::_copyConstructAnyFromData(_uno_Any*, void*, _typelib_TypeDescriptionReference*, _typelib_TypeDescription*, void (*)(void*), _uno_Mapping*) () from /usr/lib/ooo3/program/../basis-link/program/../ure-link/lib/libuno_cppu.so.3 #4 0xb7aa9d57 in cppu::_copyConstructAny(_uno_Any*, void*, _typelib_TypeDescriptionReference*, _typelib_TypeDescription*, void (*)(void*), _uno_Mapping*) () from /usr/lib/ooo3/program/../basis-link/program/../ure-link/lib/libuno_cppu.so.3 #5 0xb7aaf83b in uno_type_any_assign () from /usr/lib/ooo3/program/../basis-link/program/../ure-link/lib/libuno_cppu.so.3 #6 0x9df0f8c7 in void com::sun::star::uno::operator<<=<double>(com::sun::star::uno::Any&, double const&) () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #7 0x9e01b778 in ScChart2DataSequence::getData() () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #8 0x9d7ad96e in chart::DataSeries::getDataPointByIndex(long) () from /usr/lib/ooo3/program/../basis-link/program/libchartmodelli.so #9 0x9d4ebb82 in chart::VDataSeries::getPropertiesOfPoint(long) const () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #10 0x9d4c6547 in chart::PieChart::getMaxOffset() const () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #11 0x9d4c6cd2 in chart::PieChart::createShapes() () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #12 0x9d4fcd1e in chart::ChartView::impl_createDiagramAndContent(chart::SeriesPlotterContainer&, com::sun::star::uno::Reference<com::sun::star::drawing::XShapes> const&, com::sun::star::awt::Point const&, com::sun::star::awt::Size const&, com::sun::star::awt::Size const&) () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #13 0x9d4fde0e in chart::ChartView::createShapes() () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #14 0x9d4fe26a in chart::ChartView::impl_updateView() () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #15 0x9d4ff7dd in chart::ChartView::getTransferData(com::sun::star::datatransfer::DataFlavor const&) () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so #16 0x9d7a018c in chart::ChartModel::getPreferredVisualRepresentation(long long) () from /usr/lib/ooo3/program/../basis-link/program/libchartmodelli.so #17 0x9d8450b6 in OCommonEmbeddedObject::getPreferredVisualRepresentation(long long) () from /usr/lib/ooo3/program/../basis-link/program/libembobj.so #18 0xb7b8c742 in comphelper::EmbeddedObjectContainer::GetGraphicReplacementStream(long long, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&, rtl::OUString*) () from /usr/lib/ooo3/program/../basis-link/program/libcomphelp4gcc3.so #19 0xb7474da0 in svt::EmbeddedObjectRef::GetGraphicReplacementStream(long long, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&, rtl::OUString*) () from /usr/lib/ooo3/program/../basis-link/program/libsvtli.so #20 0xb7475ef7 in svt::EmbeddedObjectRef::GetGraphicStream(unsigned char) const () from /usr/lib/ooo3/program/../basis-link/program/libsvtli.so #21 0xb747686a in svt::EmbeddedObjectRef::GetReplacement(unsigned char) () from /usr/lib/ooo3/program/../basis-link/program/libsvtli.so #22 0xb747691e in svt::EmbeddedObjectRef::GetGraphic(rtl::OUString*) const () from /usr/lib/ooo3/program/../basis-link/program/libsvtli.so #23 0xb243c36b in SdrOle2Obj::GetGraphic() const () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #24 0xb2218675 in sdr::contact::ViewContactOfSdrOle2Obj::createViewIndependentPrimitive2DSequence() const () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #25 0xb2215267 in sdr::contact::ViewContact::getViewIndependentPrimitive2DSequence() const () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #26 0xb242b690 in SdrObject::RecalcBoundRect() () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #27 0xb24256f4 in SdrObject::GetCurrentBoundRect() const () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #28 0xb24e4f4b in SdrEditView::ForceMarkedObjToAnotherPage() () from /usr/lib/ooo3/program/../basis-link/program/libsvxcoreli.so #29 0x9df6bf31 in SdrEditView::ForceMarkedToAnotherPage() () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #30 0x9df6a33d in FuSelection::MouseButtonUp(MouseEvent const&) () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #31 0x9de90997 in ScGridWindow::DrawMouseButtonUp(MouseEvent const&) () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #32 0x9de8afeb in ScGridWindow::MouseButtonUp(MouseEvent const&) () from /usr/lib/ooo3/program/../basis-link/program/libscli.so #33 0xb6f59af9 in ImplHandleMouseEvent(Window*, unsigned short, unsigned char, long, long, unsigned long, unsigned short, unsigned short) () from /usr/lib/ooo3/program/../basis-link/program/libvclli.so #34 0xb6f5b10f in ImplHandleSalMouseButtonUp(Window*, SalMouseEvent*) () from /usr/lib/ooo3/program/../basis-link/program/libvclli.so #35 0xb6f5a013 in ImplWindowFrameProc(Window*, SalFrame*, unsigned short, void const*) () from /usr/lib/ooo3/program/../basis-link/program/libvclli.so #36 0xb51dd0d3 in SalFrame::CallCallback(unsigned short, void const*) const () from /usr/lib/ooo3/basis3.1/program/libvclplug_gtkli.so #37 0xb51d9a29 in GtkSalFrame::signalButton(_GtkWidget*, _GdkEventButton*, void*) () from /usr/lib/ooo3/basis3.1/program/libvclplug_gtkli.so #38 0xb4ea84b6 in _gtk_marshal_BOOLEAN__BOXED (closure=0xa723068, return_value=0xbf8f27b8, n_param_values=2, param_values=0xa57bf90, invocation_hint=0xbf8f27a4, marshal_data=0xb51d986c) at gtkmarshalers.c:84 The 'slow-ness' here is from: Run till exit from #0 0x9d4c6cd2 in chart::PieChart::createShapes() () from /usr/lib/ooo3/program/../basis-link/program/libchartviewli.so this has been burning away on my fast Core Duo for several minutes now without completing, where all it's child frames completed immediately.
Created attachment 62916 [details] data
I had to have a good few goes at sizing, perhaps there was some interaction with scrolling the sheet when the cursor reached the edge as well (not sure). HTH.
->kohei, the provided stack shows method ScChart2DataSequence::getData on top - well except some memory allocation stuff. I think you know that method better than me ;-).
Caching data sequence for ScChart2DataSequence::getData() *does* speed things up quite a bit for sure, but that's still a part of the story. Even with that performance gain, re-construction of the pie chart still takes quite a bit. But the perceived performance is now down from the level of "taking forever & never finishes" to "taking a long time but eventually finishes".
Let's nail this for 3.2.
The new bottleneck now is chart::PieChart::getMaxOffset(), and especially chart::VDataSeries::getPropertiesofPoint() that the first method calls.
Caching the max offset value for pie chart results in PieChart::createShapes() returning only in 0.41 seconds, as opposed to 21 seconds with only the getData() value caching. This seems like a winner to me.
Created attachment 64486 [details] change to cache the max offset value
@iha: That's the change I made in chart2. Can you take a quick look at it to see if it looks good to you? I can commit this to kohei03 cws once I get your blessing. I'll also take care of the change in sc in that cws.
@kohei, yes the attached changes in chart2 look good. Thanks a lot! :-)
@iha: great! thanks. :-) This is now fixed in kohei03 cws. This sure is a big winner with a very little code change.
re-assigning for qa verification.
verified
Seen ok in master -> closed