PDA

View Full Version : How to make OpenOffice load faster



MakeMyDay
31st January 2005, 02:24 AM
I always wonder if I'm the only one that *doesn't* know things like this, being just a few months into learning FC3, but I did a search and didn't find.

This is a cool trick to speed up OpenOffice. I'm using OpenOffice 1.1.3, FC3 and Gnome on a Dell laptop with 750MHz PIII and 512MB RAM and this made a huge difference in how fast documents load. Not sure how applicable this is to other software and configurations. So far no negative side effects observed in several days of usage.

Here's what I did:
I created a file in my home directory called ".ooquickstart" that contains the following:

#! /bin/bash
while true; do ooffice -quickstart; sleep 1; done &and made it executable

chmod u+x .ooquickstartThen opened a terminal (as user is fine) and started Gnome Session Properties by typing
gnome-session-propertiesGo to the Startup Programs tab. Click on Add. Enter this in the Startup Command box:

./.ooquickstartThen click OK, and Close. Finally, log out and log in to activate the new Gnome startup script.

Here's my layman's description of what this does. It uses the -quickstart flag in OpenOffice to keep a preloaded (and invisible to the user) instance of OpenOffice in memory. However, this preloaded instance is "consumed" when you open an OpenOffice application (Writer, Impress, Calc). This bit of code is a loop that opens new preloaded instances as they are consumed. So when you want to use OpenOffice you are grabbing a preloaded instance, and then another instance loads in the background.

So how much memory and CPU does this consume? I ran "top" in a terminal and sorted by % memory used by typing "Fn<return>". There is an instance of "soffice.bin" with no OpenOffice documents open. The CPU usage is negligable. The memory usage is 8.1%. Top says I have 515772KB RAM available, so this appears to be using 41777KB (42MB) of RAM. Ouch. I use OpenOffice quite a bit, so worth it to me, but a personal decision I guess.

With this trick enable a typical (for me) 12K byte Writer document takes about 3.5 seconds to load. Without this trick the same file takes 9 to 22 seconds to load.

I found this trick buried in this Mandrake setup script on a Slovene website: http://mandrakeprinas.org/mpn

BTW, there is a OpenOffice quickstart app for KDE (which I did not try because I use Gnome) http://segfaultskde.berlios.de/index.php?content=oooqs
and one for Gnome that I wasn't able to get installed http://ooqstart.sourceforge.net/

imdeemvp
31st January 2005, 04:04 AM
Good info I just wish the developers of fedora will make start faster.....just like abiword. Mandrake had same issue but I loads up faster now.

crackers
31st January 2005, 04:11 AM
A lot of the CPU usage you're seeing is because you're restarting the program every second. That's pretty wasteful. If you want to do pretty much the same thing, just "wrap" the Oo programs in a shell script and re-spawn ooffice as the script exits.

MakeMyDay
31st January 2005, 07:26 AM
A lot of the CPU usage you're seeing is because you're restarting the program every second. That's pretty wasteful. It's interesting that after 4.5 hours of uptime, "top" shows:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8640 steve 15 0 117m 40m 30m S 0.0 8.0 0:06.08 soffice.bin
5983 steve 16 0 5144 968 852 S 0.0 0.2 0:00.00 .ooquickstart
Just over 6 seconds total time for soffice.bin and no measureable time for .ooquckstart. This doesn't seem wasteful. Am I missing something? I agree the memory usage is high, but not the CPU usage.

If you want to do pretty much the same thing, just "wrap" the Oo programs in a shell script and re-spawn ooffice as the script exits.Can you give a bit more detail on how to do this? I can visualize how to write a script to do the quickstart, but how do I wrap it around the OO program so the script is executed instead of the OO program?

crackers
1st February 2005, 05:07 AM
It's interesting that after 4.5 hours of uptime, "top" shows:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
8640 steve 15 0 117m 40m 30m S 0.0 8.0 0:06.08 soffice.bin
5983 steve 16 0 5144 968 852 S 0.0 0.2 0:00.00 .ooquickstart
Just over 6 seconds total time for soffice.bin and no measureable time for .ooquckstart. This doesn't seem wasteful. Am I missing something? I agree the memory usage is high, but not the CPU usage.
You're right - but I was referring mostly to the memory usage. That's 10% of your memory space that you are constantly keeping active. Seems wasteful to me, but I'm like that.


Can you give a bit more detail on how to do this? I can visualize how to write a script to do the quickstart, but how do I wrap it around the OO program so the script is executed instead of the OO program?
Quickie off the top of my head (no guarantees) for an "oowriter.sh" script:


#!/bin/sh
oowriter
nohup ooffice -quickstart > /dev/null &

SHtRO
19th May 2006, 12:23 AM
Just about, it seems.

Use the original idea of putting the 'ooffice -quickstart' in the startup script but remove the loop (just run it once). Then wrap you open office calls in bash scripts:


#!/bin/bash

oocalc $*
nohup ooffice -quickstart >& /dev/null


Make sure it is executable with 'chmod +x'.

Then assign your menu options properties on those call-outs to the new scripts. You could call them something like 'start-oocalc' and 'start-oowriter' as desired.

SHtRO
19th May 2006, 12:36 AM
never mind...it doesn't work because "-quickstart" is only for windows. You could probably accomplish something similar with:

nohup ooffice -nodefault -nologo 1> /dev/null &

I receive no benefits from using '-quickstart' whatsoever.

jbannon
19th May 2006, 12:55 AM
If you try the Sun J2SE it loads just a bit quicker than with the Gnu offering. Not that much quicker but it is still noticeable.