Bug 40961 - should set configuration at installation time
Summary: should set configuration at installation time
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
3.3.3 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: perf
Depends on:
Blocks: Installer-Linux Performance
  Show dependency treegraph
 
Reported: 2011-09-17 03:56 UTC by Jérôme
Modified: 2023-12-10 17:43 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Instrumented /usr/lib/libreoffice/program/soffice (936 bytes, text/plain)
2011-09-17 04:13 UTC, Jérôme
Details
/opt/libreofficedev6.3/program/soffice in version 6.3_6.3.3.0.0 (6.17 KB, application/x-shellscript)
2019-09-26 19:33 UTC, Jérôme
Details
/opt/libreoffice7.2/program/soffice shell script in version 7.2.1 (6.57 KB, application/x-shellscript)
2021-09-26 12:25 UTC, Jérôme
Details
/opt/libreofficedev7.3/program/soffice in version 7.3.0.0.alpha0 (6.57 KB, application/x-shellscript)
2021-09-27 19:07 UTC, Jérôme
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jérôme 2011-09-17 03:56:52 UTC
At each invocation of localc, lowriter or loimpress, the
/usr/lib/libreoffice/program/soffice shell script is executed.

This script will quite always guess the same environment variables. Moreover,
guessing those values is time consuming.

I think we could cache the below environment settings into a
/var/lib/libreoffice/basis3.3/program/environment.sh file:
-----
FILE_LOCKING=auto
OPENGL_SUPPORT=no
SAL_ENABLE_FILE_LOCKING=1
SAL_NOOPENGL=true
JITC_PROCESSOR_TYPE=6
sd_cwd=/usr/lib/libreoffice/program
sd_binary=/usr/lib/libreoffice/program/oosplash.bin
-----

Those environment settings could be calculated again by a package manager
trigger.

On my old computer the cold startup of Libre Office Writer last ~24 seconds and guessing the environment variables is quite 30% of the cold startup time !
Comment 1 Jérôme 2011-09-17 04:13:35 UTC
Created attachment 51286 [details]
Instrumented /usr/lib/libreoffice/program/soffice

I instrumented the file in order to give the duration of the configuration detection.
Comment 2 Björn Michaelsen 2011-12-23 12:39:18 UTC Comment hidden (obsolete)
Comment 3 Jérôme 2012-01-30 13:27:22 UTC
I just checked with the 3.5.0rc2 version.

At each invocation of one of the below command :
"libreoffice3.5 --calc"
"libreoffice3.5 --writer"
"libreoffice3.5 --impress"

the /opt/libreoffice3.5/program/soffice shell script is executed.

This script will quite always guess the same environment variables. Moreover,
guessing those values is time consuming.

I think we could cache environment settings into a
/var/lib/libreoffice/basis3.4/program/environment.sh file.

Those environment settings could be calculated again by a package manager
trigger.
Comment 4 QA Administrators 2014-10-24 03:18:25 UTC Comment hidden (obsolete)
Comment 5 Jérôme 2014-10-24 20:23:26 UTC
The bug still occurs 4.2.6.3.

In addition, there are Valgrind flavors which aren't used in a production environment.
Comment 6 Jérôme 2014-10-24 20:27:11 UTC
My LibreOffice is running on GNU/Linux but the /usr/lib/libreoffice/program/soffice script has the below code :
---
case "`uname -s`" in
NetBSD|OpenBSD|FreeBSD|DragonFly)
---
Comment 7 QA Administrators 2015-12-20 16:17:44 UTC Comment hidden (obsolete)
Comment 8 Jérôme 2015-12-26 16:17:15 UTC
This bug still occurs with the 4.2.8.2 version.
Comment 9 Jérôme 2016-01-02 23:54:05 UTC
This bug still occurs on 5.0.4.2 version with x64 deb package.

The script which computes always the same results (since the system doesn't change) is here : /opt/libreoffice5.0/program/soffice
Comment 10 QA Administrators 2017-01-03 19:55:30 UTC Comment hidden (obsolete)
Comment 11 Jérôme 2017-01-05 21:11:59 UTC
This bug still occur on 5.2.4.2 from Debian binary packages (GNU/Linux x86_64) that I downloaded from http://www.libreoffice.org/download/libreoffice-fresh/ .

Below are the successive calls when clicking on a LibreOffice document with a file explorer or starting the application from desktop menu :
---
j@VB:~$ dpkg-query -L libreoffice5.2-debian-menus | grep "writer.desktop$"
/usr/share/applications/libreoffice5.2-writer.desktop
j@VB:~$ grep -i exec /usr/share/applications/libreoffice5.2-writer.desktop
Exec=libreoffice5.2 --writer %U
Exec=libreoffice5.2 --writer
j@VB:~$ which libreoffice5.2
/usr/bin/libreoffice5.2
j@VB:~$ ls -l /usr/bin/libreoffice5.2
lrwxrwxrwx 1 root root 35 déc.  19 18:49 /usr/bin/libreoffice5.2 -> /opt/libreoffice5.2/program/soffice
j@VB:~$ file /opt/libreoffice5.2/program/soffice
/opt/libreoffice5.2/program/soffice: POSIX shell script, ASCII text executable
j@VB:~$
---

When I look at the /opt/libreoffice5.2/program/soffice script, it performs a lot of detections each time it is invoked :
1. resolve installation directory
2. parse many test purpose options and search the related tool : --record --backtrace --strace --valgrind ...
3. detect if the host system is "NetBSD|OpenBSD|DragonFly" or not
...
Comment 12 Jérôme 2017-12-30 13:47:56 UTC
This bug still occurs on 5.2.7.2 version.
Comment 13 QA Administrators 2019-09-24 03:09:36 UTC Comment hidden (obsolete)
Comment 14 Jérôme 2019-09-26 19:33:37 UTC
Created attachment 154564 [details]
/opt/libreofficedev6.3/program/soffice in version 6.3_6.3.3.0.0

I downloaded the below daily build here :

https://dev-builds.libreoffice.org/daily/libreoffice-6-3/Linux-rpm_deb-x86_64@86-TDF/2019-09-24_23.33.05/libreoffice-6-3~2019-09-24_23.33.05_LibreOfficeDev_6.3.3.0.0_Linux_x86-64_deb.tar.gz

Into this file, I found the libreofficedev6.3_6.3.3.0.0-1_amd64.deb package which has the attached file with the below path :
opt/libreofficedev6.3/program/soffice
Comment 15 QA Administrators 2021-09-26 03:57:32 UTC Comment hidden (obsolete)
Comment 16 Jérôme 2021-09-26 12:20:47 UTC
I downloaded the latest release :
https://download.documentfoundation.org/libreoffice/stable/7.2.1/deb/x86_64/LibreOffice_7.2.1_Linux_x86-64_deb.tar.gz.torrent

The libreoffice7.2_7.2.1.2-2_amd64.deb packages has the below file :
/opt/libreoffice7.2/program/soffice

This bug still appears into the above file.
Comment 17 Jérôme 2021-09-26 12:25:01 UTC
Created attachment 175278 [details]
/opt/libreoffice7.2/program/soffice shell script in version 7.2.1
Comment 18 QA Administrators 2021-09-27 03:24:10 UTC Comment hidden (obsolete)
Comment 19 Jérôme 2021-09-27 19:04:53 UTC
I downloaded the below daily build :

https://dev-builds.libreoffice.org/daily/master/Linux-rpm_deb-x86_64@86-TDF/current/master~2021-09-26_16.13.32_LibreOfficeDev_7.3.0.0.alpha0_Linux_x86-64_deb.tar.gz

Into this file, I found the libreofficedev7.3_7.3.0.0.alpha0-1_amd64.deb package which has the file with the below path :
opt/libreofficedev7.3/program/soffice

This bug still occurs in version 7.3.0.0.alpha0.
Comment 20 Jérôme 2021-09-27 19:07:26 UTC
Created attachment 175300 [details]
/opt/libreofficedev7.3/program/soffice in version 7.3.0.0.alpha0