Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Slash OpenOffice start times & reduce bloat
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Tue Apr 08, 2003 5:41 pm    Post subject: Slash OpenOffice start times & reduce bloat Reply with quote

Fed up with twiddling your thumbs while OpenOffice loads? Tired of poor performance and excessive memory consumption? Help is at hand in the following two-stage process.

Firstly, it is seems that the app-office/openoffice-bin ebuild leaves some unstripped binaries as part of the installation. By stripping the binaries of symbols we can reduce the size of these components, thus reducing memory consumption and boosting the speed of OpenOffice a little. Simply enter the following two lines:
Code:
# cd /opt/OpenOffice.org1.0.2/program
# for bin in `file * | grep "not stripped" | egrep -o "^.+\.so[^: ]*"`; do strip ${bin}; done

Secondly, OpenOffice features a nifty "quickstart" feature whereby the code can be pre-loaded into memory. By making use of this feature we can significantly reduce the startup time for any OpenOffice application. Furthermore, that damned dialog box (you know, the one that you can't move and dominates your screen for about 15 seconds) is nowhere to be seen :D

It is simply a matter of invoking ooffice with two particular parameters (-plugin -quickstart). The only problem is that, while it works, the pre-loaded component itself has tendency to unload itself after a relatively short period of time, negating its usefulness somewhat. To get around this, use this simple but effective script (adapted from a script by Sandeep Khanna on the GNOME User's Board):
Code:
#!/usr/bin/bash
i=0
while [ $i -eq 0 ]
do
{
      dummy=`ooffice -plugin -quickstart ;`
      i=$?
      echo "OpenOffice was unloaded. Loading it again..."
}
done

I saved this as /usr/bin/ooqstart.sh then issued:
Code:
# chmod 755 /usr/bin/ooqstart.sh

Now, as I am a Gnome user I selected Applications -> Desktop Preferences -> Advanced -> Sessions. I then clicked the Startup Programs tab, clicked the Add button and typed in ooqstart.sh.

Now whenever I start Gnome, this script is loaded into memory. The script ensures that whenever the pre-loaded ooffice unloads, it will be immediately loaded again. Now give OpenOffice a spin and be happy!

If anyone has some good techniques for integrating this into their operating environment/window manager of choice, then please feel free to comment.


Last edited by kerframil on Tue Apr 08, 2003 7:38 pm; edited 2 times in total
Back to top
View user's profile Send private message
AlterEgo
Veteran
Veteran


Joined: 25 Apr 2002
Posts: 1619

PostPosted: Tue Apr 08, 2003 6:04 pm    Post subject: Reply with quote

oooqs (openoffice quickstarter) basically does the same as your script.
It leaves a configurable button in the (KDE) taskbar, from which you can start the OOo components and files, and works nicely.

The "nice" OOo startuplogo can easily be disabled:
/opt/OpenOffice.org1.0.2/program/sofficerc:
Logo=0
Back to top
View user's profile Send private message
rojaro
l33t
l33t


Joined: 06 May 2002
Posts: 732

PostPosted: Tue Apr 08, 2003 6:40 pm    Post subject: Reply with quote

alterego ... i know it's totally off-topic but your avatar totally rocks !! :)
_________________
A mathematician is a machine for turning coffee into theorems. ~ Alfred Renyi (*1921 - †1970)
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Tue Apr 08, 2003 8:41 pm    Post subject: Reply with quote

Hey this works really great ... especially after you added the ¨dummy=¨ part :) :)

This is a lot more transparent than the oooqs option. Very fast OOO now! Works under Redhat 9.0 too and very well indeed! (Yes I use Redhat sometimes... :( ) It starts in under 2 secs.!
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Thu Apr 10, 2003 5:59 pm    Post subject: Reply with quote

Hhm I try this in gentoo and in Redhat 9 and there is a difference.

In redhat it has only one soffice process running when I look at ksysguard. In Gentoo it has 6 soffice processes running. Also, It takes longer to start OO in gentoo with the preloading function. (7 sec first time, after that 1-2sec) In redhat it takes 4 secs the first time. Do you know why it loads 6 processes in gentoo and only one in redhat?
Back to top
View user's profile Send private message
puddpunk
l33t
l33t


Joined: 20 Jul 2002
Posts: 681
Location: New Zealand

PostPosted: Thu Apr 10, 2003 9:08 pm    Post subject: Reply with quote

aardvark wrote:
Hhm I try this in gentoo and in Redhat 9 and there is a difference.

In redhat it has only one soffice process running when I look at ksysguard. In Gentoo it has 6 soffice processes running.


Multi-threaded. If you were running an OpenMosix cluster, or simply a SMP system, you would be begging for multi-threaded programs :)
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Thu Apr 10, 2003 9:12 pm    Post subject: Reply with quote

puddpunk wrote:
aardvark wrote:
Hhm I try this in gentoo and in Redhat 9 and there is a difference.

In redhat it has only one soffice process running when I look at ksysguard. In Gentoo it has 6 soffice processes running.


Multi-threaded. If you were running an OpenMosix cluster, or simply a SMP system, you would be begging for multi-threaded programs :)


What determines it being multithreaded or not?
Is is glibc? or has OO.org been compiled in a certain way to behave like that?
From what I gather from you , the multi process thing in gentoo is good, even for a single CPU?
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Fri Apr 11, 2003 10:36 am    Post subject: Reply with quote

In so far as I understand it, Linux supports an implementation of the POSIX 1003.1c standard. Threads are created with the clone() system call, in contrast to the traditional fork() to spawn a copy of the current process. Further information can be found here. Threads share a common address space and many other attributes, apparently.

How this would be reflected (if at all) in top, I do not know. But puddpunk has most likely got a point. Remember that RedHat uses an new threads implementation, NTPL (what a pity that IBM's NGPT seems to be a better solution). Due to the different threading implementation in RedHat, perhaps this explains the apparent difference ...?
Back to top
View user's profile Send private message
kerframil
l33t
l33t


Joined: 19 Apr 2002
Posts: 710
Location: London, UK

PostPosted: Fri Apr 11, 2003 10:48 am    Post subject: Further NPTL/NGPT info Reply with quote

Some interesting links:

http://www-124.ibm.com/developerworks/oss/pthreads/docs/announcement
http://people.redhat.com/drepper/nptl-design.pdf

Seems like NPTL will be the way forward for threads.
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Sun Jun 15, 2003 9:18 am    Post subject: Reply with quote

Hmm, there is a "small" drawback to this approach however...
When OO for some reason crashes, it does not recover the crashed document :(
At least I have not seen that happen till now.

For the rest this is an excellent aproach
Back to top
View user's profile Send private message
ollie
n00b
n00b


Joined: 24 Nov 2002
Posts: 35

PostPosted: Sun Jun 15, 2003 10:00 am    Post subject: Reply with quote

1st; it's #!/bin/bash and, 2nd why use the crappy binary when you can compile it... :roll:

It's only like 7 hours on a p4 2,4ghz with 512mb ram..
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Sun Jun 15, 2003 11:40 am    Post subject: Reply with quote

ollie wrote:
1st; it's #!/bin/bash and, 2nd why use the crappy binary when you can compile it... :roll:

It's only like 7 hours on a p4 2,4ghz with 512mb ram..


And since everyone has at least a P 2.4 with 512 Mb ram, you make an absolutely valid point!! ;-)

The preload method also works very well for the self compiled OOO btw... and it is only marginally less "crappy" than the binary, If you succeed in compiling it at all (which i did)..
Back to top
View user's profile Send private message
peepsalot
n00b
n00b


Joined: 05 Apr 2003
Posts: 52
Location: Texas

PostPosted: Tue Jun 17, 2003 7:02 pm    Post subject: Re: Slash OpenOffice start times & reduce bloat Reply with quote

kerframil wrote:

Now, as I am a Gnome user I selected Applications -> Desktop Preferences -> Advanced -> Sessions. I then clicked the Startup Programs tab, clicked the Add button and typed in ooqstart.sh.


I use KDE, and I'm a bit of a n00b. Is there a solution similar to this for us KDE folk?
_________________
Call me butter, 'cause I'm on a roll!
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Tue Jun 17, 2003 9:58 pm    Post subject: Re: Slash OpenOffice start times & reduce bloat Reply with quote

peepsalot wrote:
kerframil wrote:

Now, as I am a Gnome user I selected Applications -> Desktop Preferences -> Advanced -> Sessions. I then clicked the Startup Programs tab, clicked the Add button and typed in ooqstart.sh.


I use KDE, and I'm a bit of a n00b. Is there a solution similar to this for us KDE folk?


For KDE I created a "Link to Application" to this preload script in the Autostart folder (go -> Autostart). This has the disadvantage that when you save your KDE session, it remembers that has soffice.bin and ooresident open and it will start up additional openoffice's (5 or 6) in addition to the ooresident script, when reloading kde.
I found a crude solution to this though: I made a little script that kills all soffice.bin and the "ooresident" script and then starts a "ooresident" freshly. This works for me!
Here's the scripts:
1. the one called in Autostart which in turn calls the other: (ooquick):
Code:

#!/bin/bash
# The ooquick script will kill all of openoffice and start a oo resident script.
# Run this script to cleanly preload openoffice.

## killing all traces of openoffice
killall -9 ooresident
killall -9 soffice.bin

## waiting for them to really dissapear (can even take a sec or 2 depending
## on the busy-ness and speed of your system)
sleep 1

## the actual keepalive is called in the bg
ooresident &


2. Basically the script from the orig poster: the "keepalive" script (ooresident)
Code:

#!/bin/bash
killall -9 soffice.bin ## just in case....
i=0
while [ $i -eq 0 ]
echo $i
do
{
      dummy=`ooffice -plugin -quickstart ;`
      i=$?
      echo $i
      echo "OpenOffice was unloaded. Loading it again..."
}
done


Both scripts , ooquick and ooresident are placed in /usr/bin
Back to top
View user's profile Send private message
wHAcKer
Apprentice
Apprentice


Joined: 18 Oct 2002
Posts: 228
Location: Grimbergen, Belgium

PostPosted: Wed Jun 18, 2003 12:34 am    Post subject: Reply with quote

why not compile it?
because the compiled version is totally fubar ;)
the bin is usable but also quite picky (there's a wrong entry in .sversion or something which forces you to remove the ~/.openoffice dir every time before you run the program.
(running unstable)
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Wed Jun 18, 2003 7:41 am    Post subject: Reply with quote

wHAcKer wrote:
why not compile it?
because the compiled version is totally fubar ;)
the bin is usable but also quite picky (there's a wrong entry in .sversion or something which forces you to remove the ~/.openoffice dir every time before you run the program.
(running unstable)


Eerm, I for one, have compiled it and this whole topic also applies to those that compiled it themselves too. The self compiled OOO is not even that much faster that the binary actually.
Back to top
View user's profile Send private message
iplayfast
l33t
l33t


Joined: 08 Jul 2002
Posts: 642
Location: Cambridge On,CA

PostPosted: Wed Jun 18, 2003 2:17 pm    Post subject: Reply with quote

ollie wrote:
It's only like 7 hours on a p4 2,4ghz with 512mb ram..


It's more like 36 hours on a Pentium III 450 mhz. (I was beginning to think it was just compiling the same thing over and over again... It is afterall only 13 meg).
Back to top
View user's profile Send private message
aardvark
Guru
Guru


Joined: 30 Jun 2002
Posts: 576

PostPosted: Wed Jun 18, 2003 2:37 pm    Post subject: Reply with quote

iplayfast wrote:
It is afterall only 13 meg).


????????? :?:
Back to top
View user's profile Send private message
iplayfast
l33t
l33t


Joined: 08 Jul 2002
Posts: 642
Location: Cambridge On,CA

PostPosted: Wed Jun 18, 2003 4:48 pm    Post subject: Reply with quote

aardvark wrote:
iplayfast wrote:
It is afterall only 13 meg).


????????? :?:


whoops, my bad. 176 meg. I guess that explains it. :oops:
Back to top
View user's profile Send private message
tecknojunky
Veteran
Veteran


Joined: 19 Oct 2002
Posts: 1937
Location: Montréal

PostPosted: Sun May 02, 2004 4:14 pm    Post subject: Reply with quote

Is this a coincidence?
_________________
(7 of 9) Installing star-trek/species-8.4.7.2::talax.
Back to top
View user's profile Send private message
PovMan
Guru
Guru


Joined: 30 Sep 2002
Posts: 375
Location: Australia

PostPosted: Sun May 02, 2004 11:27 pm    Post subject: Reply with quote

Code:
emerge oooqs

For kde ppl... (maybe it'll run in gnome too, i dunno)
This does the same thing except it has a context menu which you can start openoffice applications with.
_________________
I am SPAM, hear me roar.
Before posting your own topic, try to answer at least one unanswered one.
Back to top
View user's profile Send private message
djkork
n00b
n00b


Joined: 25 May 2004
Posts: 45
Location: Madrid

PostPosted: Tue May 25, 2004 12:47 am    Post subject: Reply with quote

if have tested it with openoffice-ximian and it's faster than ooffice.... it works very well... the only thing that you have to change is "ooffice --> xooffice" in the script....

Ah... there is a bug in the script.... first line is
Code:
#! /bin/bash
instead of
Code:
#! /usr/bin/bash
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum