Issue 27259 - Opening document with formulas is extremely slow in some cases
Summary: Opening document with formulas is extremely slow in some cases
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOo 1.1.1
Hardware: PC Linux, all
: P3 Trivial (vote)
Target Milestone: OOo 2.0
Assignee: ulf.stroehler
QA Contact: issues@gsl
URL:
Keywords: oooqa
: 21304 26003 28015 (view as issue list)
Depends on:
Blocks:
 
Reported: 2004-03-31 20:54 UTC by mstevens
Modified: 2005-02-04 19:33 UTC (History)
1 user (show)

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


Attachments
Openoffice writer document with many equations, created under previous OpenOffice release. (86.44 KB, application/vnd.sun.xml.writer)
2004-03-31 20:55 UTC, mstevens
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description mstevens 2004-03-31 20:54:42 UTC
Opening the attached document on an Athlon XP 1800 machine with 512mb of RAM
running Fedora Core 1 freezes the openoffice UI for several minutes, and when
the document does open attempts to scroll again cause freezes. 
Strace shows many calls to read/write/mmap, and seems to be creating many
temporary files:

open("/usr/java/j2sdk1.4.2_04/jre/lib/fonts/LucidaTypewriterBold.ttf", O_RDONLY)
= 28
open("/tmp/svp29.tmp", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 28
open("/tmp/svp29.tmp/svp6l.tmp", O_RDWR) = 28
open("/tmp/svp29.tmp/svp6l.tmp", O_RDWR) = 28
open("/tmp/svp29.tmp", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 29
open("/tmp/svp29.tmp/svp6m.tmp", O_RDWR) = 29
open("/tmp/svp29.tmp/svp6m.tmp", O_RDWR) = 29
open("/tmp/svp29.tmp", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 28
open("/tmp/svp29.tmp/svp89.tmp", O_RDWR) = 28
open("/tmp/svp29.tmp/svp89.tmp", O_RDWR) = 28
Comment 1 mstevens 2004-03-31 20:55:22 UTC
Created attachment 14226 [details]
Openoffice writer document with many equations, created under previous OpenOffice release.
Comment 2 flibby05 2004-03-31 21:20:48 UTC
works fine here with 1.1.1rc3 on SuSE 9.0
Comment 3 flibby05 2004-03-31 21:23:49 UTC
>> open("/usr/java/j2sdk1.4.2_04/jre/lib/fonts/LucidaTypewriterBold.ttf",
       >> O_RDONLY)

The path looks very suspicous, because normally one doesn't install font files
into the java directory.

Did you install it there or is this maybe an unhappy result of OOo-setup?


Comment 4 mstevens 2004-03-31 21:39:55 UTC
The fonts are actually there. rpm -q -l j2sdk finds them in the java rpm, so I
assume they came from sun. The java install is j2sdk-1_4_2_04-linux-i586.rpm
downloaded from java.sun.com in the last few weeks. I've just tried reinstalling
OO and telling it not to use a JRE, but it doesn't seem to change the behaviour.
Comment 5 mci 2004-04-01 08:01:13 UTC
hi mstevens,

thanks for using and supporting OpenOffice.org...

Opening your document on Solaris and windows went fine...
Comment 6 ulf.stroehler 2004-04-01 10:25:55 UTC
Confirming.
Comment 7 h.ilter 2004-04-07 16:46:42 UTC
HI->FME: Include Math objects.
Comment 8 stefan.baltzer 2004-04-07 17:12:46 UTC
SBA+US: ...but in this case, HDU is the winner. On my LINUX machine (JDS), we
found this with gdb (using Build srx645_m38-1_01.8770):
in OutputDevice::GetTextBoundRect(Rectangle&, String const&, unsigned short,
unsigned short, unsigned short) const ()
   from /[PATH]./program/libvcl645li.so

Note: Target set to OOo 1.1.3 as it's unclear if the effort and risk fits the
timeline for 1.1.2.
Comment 9 stefan.baltzer 2004-04-15 09:53:05 UTC
*** Issue 21304 has been marked as a duplicate of this issue. ***
Comment 10 stefan.baltzer 2004-04-15 09:53:43 UTC
*** Issue 26003 has been marked as a duplicate of this issue. ***
Comment 11 stefan.baltzer 2004-04-15 09:58:01 UTC
SBA: This one is younger but (hopefully) almost "nailed down". Please take the
cases of issue 21304 and issue 26003 into account. I adjusted the title because
the findings seem to have platform dependencies.
Comment 12 michael.ruess 2004-04-21 08:56:05 UTC
*** Issue 28015 has been marked as a duplicate of this issue. ***
Comment 13 hdu@apache.org 2004-04-23 08:56:07 UTC
I debugged this issue on JDS and the problem is that
- there are characters involved, that are not available in the selected font so
glyph fallback is attempted
- some of the fonts in the glyph fallback list are X11 fonts with a good
coverage e.g. Dotum
- especially on Western systems just "opening an X11 font" which contains many
glyphs freezes the X11 server for a while because the X11 server waits for the
font server, which renders all the glyphs even though this is not requested by
the application
- distributions targeted for Asian markets use a different X11 font server,
which uses different heuristics which work much faster

To confirm this can you please check that when you open the document and the
system seems to hang that not the application soffice.bin is eating all the CPU
but either the X server or the X font server?

Another method of confirming this hypothesis is to open the "xfontsel"
application and go through all the available font families. I'm quite sure on
your system you will notice for some font families (especially east asian ones)
the system seems to freeze for a couple of seconds.

Other than that I think that one of the Win98 tasks issue 21304 and issue 26003
should be reopened, because the X11 font server freeze does not apply there.
Comment 14 hdu@apache.org 2004-04-23 10:59:23 UTC
Here is a link which quantifies the performance problem of the XServer when CJK
fonts come into play: http://x-tt.sourceforge.jp/documentation.html
This page also offers a solution for systems which show this problem.
Comment 15 thomas.lange 2004-05-10 09:08:04 UTC
Would it be a good idea to have an option in the "Tools/Options" dialog that
allows the user to customize this?
Comment 16 hdu@apache.org 2004-05-14 15:58:42 UTC
I don't think making this customizable will help much. The much easier
alternative is already there: Use a font that has the required glyphs.

The remainder of the task is to reduce the glyph fallback to X11 fonts by using
them only when non-X11 fonts have already be tried.
Comment 17 Martin Hollmichel 2004-06-25 14:27:50 UTC
scheduled to 1.1.4.
Comment 18 hdu@apache.org 2004-08-25 16:10:03 UTC
Retargeting as agreed with SBA and US. Even with the suggested fix of delaying
the use of X11 fonts for glyph fallback after all other directly accessible font
files have been tried, the problem would still show up on systems with fonts
insufficient to the text's requirements.

Workarounds on the X11 server: use the xtt font module instead of the freetype
module to avoid the "rastering a huge X11 font" induced delays.
Comment 19 hdu@apache.org 2004-10-27 12:13:42 UTC
As mentioned above the problem cannot completely be solved if we still want
glyph fallback, because sometime only X11 fonts have the required glyphs. When a
non-xtt module is used for X11 font support the extremely slow response is
designed in...

Though the general problem is unsolvable from the OOo perspective I put a fix
into the CWS vcl29, which tries highest quality fonts first. Since X11 only
fonts are being evaluated low quality they are only tried if the better font
alternatives have been used up. So the problem does not disappear completely,
but it will be triggered with a lower probability...
Comment 20 hdu@apache.org 2004-10-28 17:50:14 UTC
reopening for reassignment
Comment 21 hdu@apache.org 2004-10-28 17:51:06 UTC
reassigning
Comment 22 hdu@apache.org 2004-10-28 17:54:02 UTC
HDU->US: please verify in CWS vcl29
Testing hints: this is a little difficult to test... just make sure things don't
get worse and that client side fornts are used for glyph fallback fonts are
before the X11 fonts.
Comment 23 ulf.stroehler 2004-11-17 16:41:49 UTC
> just make sure things don't get worse and that client side fornts are used for
glyph fallback > fonts are before the X11 fonts

In fact I seem to have a problem with glyph fallback when CTL (hebrew in this
case) is involved.
Comment 24 ulf.stroehler 2004-11-17 16:49:14 UTC
us->hdu: pls. contact me, so that we can have a look at the newly glyph fallback
problem together. System is fedor core 3 - JDS is fine though.

Btw. the performance has improved dramatically. Thx. for that.
Comment 25 ulf.stroehler 2004-11-17 17:00:28 UTC
Interesting aspect: the libvcl s (on tausch volume) you provided at our latest
debugging seesion work fine for me. Only the cws does not. Buil problem on cws?
Comment 26 hdu@apache.org 2004-11-18 10:44:11 UTC
Well, the fix for the original problem is to reorder the fonts used for the
glyph fallback feature. The fonts are now sorted to get "highest quality fonts
first", pushed the font that was previously successful for that particular
bugdoc ("LucidaTypewriter") out of the list of glyph fallback fonts.

Increasing the number of slots in that list from 8 to 12 fixes the particular
problem you are seeing. On the other hand the higher this number of slots is the
worse is the worst case performance in the glyph fallback case... and the
performance impact of this case triggered the original issue report...
Comment 27 hdu@apache.org 2004-11-18 10:45:10 UTC
HDU->US: please verify in the respin of CWS vcl29
Comment 28 ulf.stroehler 2004-11-18 11:54:21 UTC
Verified in respin of CWS vcl29.
Comment 29 ulf.stroehler 2005-02-04 19:33:42 UTC
Verified in MWS m77.