Issue 122911 - Slow for particular simple 11KB ODS spreadsheet
Summary: Slow for particular simple 11KB ODS spreadsheet
Alias: None
Product: Calc
Classification: Application
Component: open-import (show other issues)
Version: 4.0.0
Hardware: PC Windows, all
: P3 Normal with 2 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
Keywords: regression
Depends on:
Reported: 2013-07-31 11:27 UTC by Petr Vones
Modified: 2014-02-12 12:26 UTC (History)
6 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.0.0
Developer Difficulty: ---

Example of ODS document that loads slowly (10.33 KB, application/vnd.oasis.opendocument.spreadsheet)
2013-07-31 11:27 UTC, Petr Vones
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Petr Vones 2013-07-31 11:27:24 UTC
Created attachment 81214 [details]
Example of ODS document that loads slowly

Loading of simple spreadsheet in ODS format takes 12 sec on AMD Athlon 3200 machine. Saving is less than one second. When converted to XLS format it loads immediately. 

It looks like exactly opposite issue to bug 122827
Comment 1 Rainer Bielefeld 2013-07-31 12:18:14 UTC
Steps how to reproduce Reproducible with  "AOO 4.0.0-Dev – German UI / German locale  [AOO400m3(Build:9702)  -  Rev. 1503709 (2013-07-17) ]" on German German WIN7 Home Premium (64bit)", Common 4.0-dev User Profile:

AOO needs 7 seconds to open reporter's sample document, LibO 4.0 needs 1/2s

Not a general problem, a self created sample document similar to reporter's open's fast as lightning.

Any Idea what in your document might cause the problem?
Comment 2 Petr Vones 2013-07-31 12:29:26 UTC
I have been experimenting with it for a while. I guess that important parts is to use column formatting (B column in my sample) for calculated SUM column (E1 cell in my sample) and create another calculated cell based on the SUM cell result (E2 cell in my sample) with formatting as well.
Comment 3 Rainer Bielefeld 2013-07-31 12:32:06 UTC
3s with AOO 3.4.0, also bad, but only half time that AOO 4 needs

Strange, was there any kind of cache or similar enduring also OOo termination? OOo 3.1.1 and 2.0.2 also needed app. 7s for first attempt to open the document, but all later tests only took 3s.
Thank you for additional info
Comment 4 Petr Vones 2013-07-31 12:42:01 UTC
Is there any way to record a macro by steps performed in the OO (the same way like MS Office does) ? I could easily record the steps how to create such slow document.
Comment 5 Edwin Sharp 2013-07-31 13:27:34 UTC
7 seconds on Rev. 1507307 Win 7.

Intel i3 2.93GHz 4GB RAM
Comment 6 Oliver-Rainer Wittmann 2013-08-09 14:56:16 UTC
Without accurate time keeping I can confirm that the document needs more time for loading in AOO 4.0.0 than in AOO 3.4.1 on my system.
--> adding keyword regression
Comment 7 Clarence GUO 2013-09-12 06:13:16 UTC
I think it is not a regression.
I tested both 3.4.0 and 4.0 on my machine, Intel Core(TM2) Duo CPU E6750 2.55 GHz, 1.97 GHz, 2G RAM, Windows XP, follow below steps. I tested several times and get an average time.

Load file after restart soffice process: Insure there's no soffice process in task manager, if there is, kill it, then start AOO, load file from menu, File->Open, on 3.4, consuming time is 3.482s; on 4.0, time is 3.082s
Load file from an existing soffice process: Afterwards, open the sample from menu File->Recent Files, on 3.4, consuming time is 2.538s, on 4.0, time is 2.53s.
I cannot see significant gap between 3.4.0 and 4.0.

I note many of you mentioned first attempt will be 6-7s. I also find when I first start AOO then do first attempt, the time will be 6-7s, but once exit from AOO even terminate the process in task manager and restart AOO then load again, the time will be 3+s. This phenomenon I can find on both 3.4.0 and 4.0.
So I think there is no regression.

I also tested LibreOffice. First run LibreOffice4.1, first attempt is around 6s too. Then terminate the process and restart LibreOffice, loading the file also need 3+s. The result is same with AOO4.0 so far. But the difference is afterwards once load the file again from menu File->Recent Files, LibreOffice will use only 0.5s, but AOO4.0 needs 2+s.

I debugged code and find 80% time are spent on calling XML_Parse(called in sax). XML_Parse is a third party code of expat.
Comment 8 Oliver-Rainer Wittmann 2013-09-12 07:25:39 UTC
I did no real profiling - I just looked at the system watch.
On my system (64bit Windows 7, Intel Core (TM) i7-2720QM CPU 2.20GHz, 12GB RAM) I have:
- AOO 3.4.1 --> 2-3 seconds
- AOO 4.0.0 --> 5-6 seconds
- trunk build from build bot (rev. 1521488) --> 5-6 seconds.
Thus, I can still confirm this issue.

May be the issue is system-dependent.
- Windows 7 (Rainer and myself) --> reproducible
- Windows XP (Clarence) --> not reproducible

@Petr Vones:
Which version of Windows you are using?
Comment 9 Clarence GUO 2013-09-12 08:06:45 UTC
Yes, Oliver, you are right. It's system dependent.
I also tested on Win7 64 bit, Intel Core (TM) i7 i7-3700, 3.4GHz, 16G RAM, then time is 5+s, and 3+s for first open the sample when restart soffice process and for open the sample on an existing soffice process. But on AOO 3.4.0, time is around 2-3s and 1-2s.
Comment 10 Clarence GUO 2013-09-12 09:35:17 UTC
I also tested on a MAC 10.5.8, Intel 2GHz Core 2 Duo, 2G RAM, haven't find performance gap between OpenOffice3.3 and Apache OpenOffice4.0, the time are both 6+s for loading sample from a retarted soffice process and 4+s for loading sample from an existing soffice process.
I haven't try Linux, but suppose it is Win7 only.
Comment 11 Petr Vones 2013-09-12 21:20:34 UTC
(In reply to Oliver-Rainer Wittmann from comment #8)
> @Petr Vones:
> Which version of Windows you are using?

Windows XP SP3 32 bit, AMD Athlon 3200 machine. The difference between loading the same file saved in XLS format is very noticeable.
Comment 12 Clarence GUO 2013-09-13 02:21:39 UTC
I also tested against AOO350ml(Build9610) Rev.1377529 on another Win7 64 bit machine, Intel i7-2600 CPU @ 3.40GHz ,8.0GB Memory, the time is 3+s for loading sample from a retarted soffice process and 1+s for loading sample from an existing soffice process. So it should be a regression after AOO3.5.
Comment 13 Andre 2013-10-01 09:52:15 UTC
Sorry for the delay.  I was on vacation.

(In reply to Clarence GUO from comment #7)

> I debugged code and find 80% time are spent on calling XML_Parse(called in
> sax). XML_Parse is a third party code of expat.

80% inclusive or exclusive function calls?  When inclusive then this is to be expected when loading an XML document and no indication for a problem of expat.
Comment 14 Andre 2014-02-12 12:26:23 UTC
I looked into the bug document and found that it is not as simple as it looks:

- It has 23 sheets

- Each sheet has a row with a repeat count of 1048567:
<table:table-row table:style-name="ro2" table:number-rows-repeated="1048567">
   <table:table-cell table:number-columns-repeated="5"/>
The row may be empty but it still results in a couple of function calls per repeated row.

For these reasons I set the importance to normal.