Difference between revisions of "Merge UNO Dlls"
m (merge dll performance) |
|||
(2 intermediate revisions by the same user not shown) | |||
Line 95: | Line 95: | ||
We can use some macros to implement the merge conveniently. | We can use some macros to implement the merge conveniently. | ||
+ | Here is a detail design:[http://wiki.services.openoffice.org/wiki/Performance/Ideas/Easy_UNO_Services_Merging Easy UNO Services Merging] | ||
== Experimental Result == | == Experimental Result == | ||
− | We did an experiment of merging 13 UNO Dlls(all 1.6M) to 1 Dll(after merged 1.2M) and got 5.48% time win during cold start and got 4.87% time win during warm start. | + | We did an experiment of merging 13 UNO Dlls(all together 1.6M) to 1 Dll(after merged 1.2M) and got 5.48% time win during cold start and got 4.87% time win during warm start. |
+ | [[Category:Performance]] |
Latest revision as of 03:24, 7 March 2009
Dlls statistics
The table shows the dlls statistics in my OpenOffice.org 3.0 zh_CN version product suite.
size | amount |
<200K | 215 |
200K<size<500K | 64 |
500K<size<1M | 33 |
1M<size<5M | 32 |
>5M | 4 |
348 |
Another table shows how many dlls loaded during starting a swriter module with a blank odt file.
size | amount |
<200K | 49 |
200K<size<500K | 16 |
500K<size<1M | 13 |
1M<size<5M | 11 |
>5M | 4 |
93 |
From the statistics we can see, too many small dlls loaded at startup, and this cause too much redundant I/O(see http://msdn.microsoft.com/en-us/magazine/bb985014.aspx). So, merging some small dlls into bigger one will reduce I/O time.
UNO Dlls
What we say UNO Dlls is the dll which provides UNO service only, so it exports only few same functions according to the UNO architecture(compare to other basic function provider like sal3.dll, it exports a lot of basic functions). That is:
- component_getImplementationEnvironment
- component_writeInfo
- component_getFactory
There are more than 130 UNO dlls in OpenOffice.org product suite, and most of them are small.
How to merge?
Merging UNO dlls is easy, because:
- simple and few export functions
- there is no direct dependence from each other
- just need few changes of code
All of this are benefit from the factorial create method of UNO service.
How to merge(suppose dll A and dll B merged into a new dll C):
- Decide which UNO dlls need to be merged, a simple principle is similar functional and most frequent used UNO dlls need to be merged into one.
- Modify A and B's export function name to inner name which like component_getFactoryA in the implementation file, modify the makefile not to build the dll, but libs
- Create a new module to build the new dll C which is the new UNO dll, implement the export function in which calls component_getFactoryA and other functions.
- Register the new dll C into service.rdb.
We can use some macros to implement the merge conveniently.
Here is a detail design:Easy UNO Services Merging
Experimental Result
We did an experiment of merging 13 UNO Dlls(all together 1.6M) to 1 Dll(after merged 1.2M) and got 5.48% time win during cold start and got 4.87% time win during warm start.