summaryrefslogtreecommitdiff
path: root/doc/perform.txt
blob: adc095ad324cef4596e7abe3f27f92f623792979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
** Slow things for no reason:

   + 'libunoexcept.so'
	+ -all- exception type data in here ...
	+ really early in the link chain
	    + ~all UNO plugins => loaded as 'local' modules.
	    + 1 method:
		+ extern "C" megaThrow ():
		    + try { throw (a); } catch () {};
		      etc...


   600 million cycles:
	+ desktop::FirstStart::execute
	+ svt::RoadmapWizard::RoadmapWizard
		+ [foo] - bogus ? just hides vcl init ...


+ Why load the VCL resource file before showing splash
    + only then load intro.bmp [why?]
    + mainapp_16.png ? - is it the WM icon ?
	+ can we defer that ?
	    [ save 12ms + seeks: ]
	    + libfileacc.so - 2
	    + stat program/res/ - 1
	    + stat share/config/res - 1
	    + resource/vcl680en-US.res
		+ 2 + read/seek/read - 2

    + do the force-into-memory thing for types.rdb & services.rdb

+ Manual edit of ~/.setup.xcu with vi - works, settings still persists

OO.o potential performance issues:
	+ loads of bogus lseeking to see if we've hit EOF
	  in resource file reading [ screws with kernel
	  readahead ]
		+ these files are not dynamic anyway [!]
		+ we have already statted them before opening.
	+ load all soffice.cfg/modules/swriter/* toolbar info
		+ however - we only need a few toolbars,
			+ can we not load/parse as needed ?
			[ + do we need names for menu or something ? ]
	+ load _lots_ of configuration data:
		+ do we need it all ? [ are we sure ? ]

	+ GL.so - who is loading that on startup & why ?
	+ VCL dependency pruning:
		+ libsndfile.so.1, libportaudio.so.0 (nas?)
		+ hack plugin code into salsound2.cxx
		    + dyload them as needed.
		+ [ sndfile == 300kb+ ] portaudio == small.
		+ dlopen sndfile as needed,
			+ static link portaudio if non-system
		+ cut at 'X11SalInstance::CreateSalSound' ?
	+ psprint
		+ jvmfwklib
	+ SVX deps pruning
		+ libavmedia - linked in (why?)

	+ Java deps too entrenched to prune:
		+ sj2 (libj680li_g.so) -> automation, basic, sfx2, so3 - odd.
			depends on jvmaccesslib
		+ jvmaccesslib / jvmfwk - in vcl, psprint, desktop, svx

TODO:
	+ analyse all libraries loaded on writer startup
		+ grep 'open("' /tmp/newlog  | grep -v 'ENOENT' | grep -v '<unfinished>'
	+ re-analyse for running 'soffice' not soffice.bin [!]

** osl_psz_loadModule
	+ loads simplereg, nestedreg twice too ...
	+ configmgr2.uno.so - 12x
	+ libgcc3_uno.so - 21x 
	+ libfwk - 15x
	+ libsvt - 3x
	+ Duplicate opens are fairly low-cost
		- reading glibc/elf/* - not a problem ...

0.000040 0.46013 open("/usr/lib/libjpeg.so.62", O_RDONLY) = 3 [28330]	- why - do we load any jpegs ?
	+ required by svtools 's source/filter.vcl/jpeg/
	  [are these used much?]

0.000030 0.00930 open("./libjvmfwk.so.3", O_RDONLY) = 3 [28330]	- why load java stuff on startup ?
0.000031 0.27792 open("./libjvmaccessgcc3.so.3", O_RDONLY) = 3 [28330] - java bits ?
	+ required by vcl's Java integration foo ...
		+ could we de-couple that ?

0.000038 0.61595 open("/usr/lib/libxml2.so.2", O_RDONLY) = 3 [28330]	- where do we parse xml this early ?


	+ Add timing to registry read / cache bits etc.
	+ why are we loading libavmedia*.so on startup ?
	+ check all '.res' files we use & why ...
		[ what triggers their use ? ]

Thoughts:
	+ lots of resource file reading
		+ could we mmap that ?