https://issues.apache.org/ooo/show_bug.cgi?id=124065
[email protected] changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from [email protected] --- [ROOT CAUSE] When there are too many Name Ranges in the ODF file, it takes a very long time to import the document. By using Purify, we found most of the time is used by function ScRangeData::Clone(), which is called by function ScCollection::= while constructing a new ScRangeName object. Function: ScRangeData::Clone Calls: 1,511,522 Function time: 140,541.25 (3.08% of Focus) F+D time: 845,851.27 (18.51% of Focus) In my test, there is 1004 name ranges. In funtion ScXMLImport::SetNamedRanges(), it will first add 1004 new Name Ranges, then it will loop the 1004 entries to update the content and grammer. You can see that 1004 Name Ranges will lead to 1.5 Million (roughly 1004*1004) calls of ScRangeData::Clone(), which is quite time consuming, thus resulting a slow importing of the document. Function: ScXMLImport::SetNamedRanges Calls: 1 Descendant ScNamedRangesObj::addNewByName calls:1004 ScNamedRangeObj::SetContentWithGrammar calls:1004 1) create new name ranges Function: ScNamedRangesObj::addNewByName Calls: 1,004 Descendant ScNamedRangesObj::ImplAddNewByScopeAndName calls: 1004 2) update the name ranges Function: ScNamedRangeObj::SetContentWithGrammar Calls: 1,004 Descendant ScNamedRangeObj::Modify_Impl calls: 1004 [RESOLUTION] To improve the performance, we will not create a copy of the ScNameRange object, instead we will just use the existing ScNameRange to update. -- You are receiving this mail because: You are on the CC list for the bug. You are the assignee for the bug. You are watching all bug changes.
