trimming fat

In view of the ongoing effort to refine dhis2 into the lean and mean
machine which we know is trying to break out inside of it, and also as
part of my continuing exploration of what exactly is going on, I've
done a bit of an analysis of the jars packaged inside the dhis.war.
(I've got these in a spreadsheet - should put them on the wiki or
somewhere if only I knew how.)

Listed in order of size we have:

name size cumulative
wstx-api-2.9.jar 1443 1443
acegi-security-tiger-1.0.2.jar 3091 4534
dhis-support-transaction-2.0.1-SNAPSHOT.jar 3653 8187
aopalliance-1.0.jar 4467 12654
dhis-i18n-translationstore-hibernate-2.0.1-SNAPSHOT.jar 6836 19490
dhis-i18n-upgrader-2.0.1-SNAPSHOT.jar 7181 26671
jsr107cache-1.0.jar 8277 34948
dhis-support-external-2.0.1-SNAPSHOT.jar 9416 44364
dhis-useradminandsecurity-2.0.1-SNAPSHOT.jar 9814 54178
staxwax-1.0.4.jar 10956 65134
dhis-i18n-static-2.0.1-SNAPSHOT.jar 12143 77277
dhis.jar 13419 90696
geronimo-spec-jta-1.0-M1.jar 13473 104169
dhis-i18n-db-2.0.1-SNAPSHOT.jar 15162 119331
dhis-service-user-hibernate-2.0.1-SNAPSHOT.jar 15300 134631
asm-attrs-1.5.3.jar 16757 151388
dhis-options-2.0.1-SNAPSHOT.jar 18344 169732
cave-process-1.0.3.jar 19408 189140
dhis-support-hibernate-2.0.1-SNAPSHOT.jar 20773 209913
dhis-service-organisationunit-2.0.1-SNAPSHOT.jar 22173 232086
dhis-service-administration-2.0.1-SNAPSHOT.jar 24072 256158
xpp3_min-1.1.4c.jar 24956 281114
asm-1.5.3.jar 26361 307475
stax-api-1.0.1.jar 26514 333989
commons-email-1.1.jar 30651 364640
commons-fileupload-1.1.1.jar 31909 396549
dhis-web-dashboard-integration.jar 33002 429551
dhis-support-webwork-2.0.1-SNAPSHOT.jar 34793 464344
dhis-web-maintenance-dataadmin.jar 36180 500524
dhis-web-maintenance-settings.jar 36714 537238
commons-logging-api-1.1.jar 44598 581836
commons-codec-1.3.jar 46725 628561
dhis-support-system-2.0.1-SNAPSHOT.jar 51125 679686
commons-logging-1.1.jar 52915 732601
jep-2.24.jar 56755 789356
commons-io-1.1.jar 61562 850918
dhis-service-datamart-default-2.0.1-SNAPSHOT.jar 62188 913106
activation-1.1.jar 62983 976089
oro-2.0.8.jar 65261 1041350
dhis-web-validationrule.jar 65645 1106995
dhis-web-maintenance-user.jar 73276 1180271
dhis-service-reporting-2.0.1-SNAPSHOT.jar 76962 1257233
dhis-web-datamart.jar 77406 1334639
ibatis2-common-2.1.7.597.jar 85038 1419677
velocity-tools-1.2.jar 88194 1507871
dhis-web-maintenance-dataset.jar 90226 1598097
oscore-2.2.4.jar 91078 1689175
xpp3-1.1.3.3.jar 93395 1782570
servlet-api-2.4.jar 97693 1880263
dhis-service-jdbc-2.0.1-SNAPSHOT.jar 101799 1982062
dhis-web-maintenance-organisationunit.jar 104568 2086630
xml-apis-1.0.b2.jar 109318 2195948
rife-continuations-0.0.2.jar 116956 2312904
dhis-service-core-2.0.1-SNAPSHOT.jar 126194 2439098
commons-validator-1.3.1.jar 138956 2578054
commons-digester-1.7.jar 139966 2718020
dhis-web-dataentry.jar 144245 2862265
junit-4.4.jar 161477 3023742
ognl-2.6.9.jar 167958 3191700
ognl-2.6.11.jar 168081 3359781
stax2-api-3.0.1.jar 179977 3539758
commons-beanutils-1.7.0.jar 188671 3728429
xml-apis-1.3.02.jar 194205 3922634
commons-lang-2.1.jar 207723 4130357
dhis-api-2.0.1-SNAPSHOT.jar 213598 4343955
dhis-web-commons-2.0.1-SNAPSHOT.jar 218342 4562297
ehcache-1.5.0.jar 264400 4826697
dhis-web-importexport.jar 281502 5108199
cglib-2.1_3.jar 282338 5390537
spring-core-2.5.6.jar 285491 5676028
xwork-1.2.3.jar 286284 5962312
dhis-web-maintenance-datadictionary.jar 297665 6259977
ibatis2-sqlmap-2.1.7.597.jar 304649 6564626
jcommon-1.0.14.jar 307917 6872543
dom4j-1.6.1.jar 313898 7186441
backport-util-concurrent-3.1.jar 331716 7518157
commons-math-1.2.jar 338488 7856645
log4j-1.2.12.jar 358085 8214730
dhis-web-reporting.jar 376768 8591498
mail-1.4.jar 388864 8980362
velocity-1.5.jar 392124 9372486
dhis-service-importexport-2.0.1-SNAPSHOT.jar 407408 9779894
xstream-1.3.jar 411090 10190984
antlr-2.7.6.jar 443432 10634416
acegi-security-1.0.2.jar 456993 11091409
postgresql-8.3-603.jdbc4.jar 474746 11566155
woodstox-core-asl-4.0.3.jar 481111 12047266
spring-beans-2.5.6.jar 488282 12535548
joda-time-1.5.2.jar 531326 13066874
commons-collections-3.2.jar 571259 13638133
c3p0-0.9.1.2.jar 610790 14248923
jxl-2.6.jar 660390 14909313
mysql-connector-java-5.1.6.jar 703265 15612578
freemarker-2.3.4.jar 789043 16401621
poi-2.5.1-final-20040804.jar 802216 17203837
h2-1.1.109.jar 1163608 18367445
jfreechart-1.0.11.jar 1360956 19728401
jasperreports-2.0.2.jar 1788352 21516753
itext-1.4.8.jar 1891191 23407944
hibernate-3.2.6.ga.jar 2274768 25682712
derby-10.4.2.0.jar 2446767 28129479
spring-2.5.6.jar 2949500 31078979
webwork-2.2.6.jar 3218671 34297650
jdtcore-3.1.0.jar 3555707 37853357
    
Total 37853357

As you see we are carrying 37M of jar around. Which sounds about
right - the dhis.war weighs in at about 35M. That's fairly big - I've
got some thoughts about reducing it which I'd appreciate your comment
on. Because the above is listed by size, it makes sense to focus on
the bottom candidates as much as possible. Of the approx 38M, half of
that is taken up by the top 10 jars (out of 104 in total). The dhis*
jars (34 of them) account for about 3M which means that there are
about 60 'minor' jar dependencies which together account for around
15M.

1. jdtcore doesn't seem to be required in a production server. Maybe
it is required for debugging in eclipse. If we take it out we get
down to a war file of 32.5M which is a 10% improvement and full
functionality (I think)

2. derby - though I was the one pushing for derby support, it doesn't
100% work, we are so far quite happy with H2 for the embedded stuff
and if we take it out of the production release we get down to 30.2M

How to break the mystical 30M barrier ....

3. As far as I can see we are not using freemarker at all. I guess
we use velocity so it makes sense we wouldn't use both. Take it out
and we'd be down to 29.6M

As far as I can tell these can happen right away.

Other thoughts which can't happen right away:

4. We should not need to have jxl and poi. Much though we love
microsoft its enough to love the buggers once. We need to dump one of
them - probably jxl - and port the existing code to the other. Am I
right in thinking we are not yet using POI - I haven't found
references to it but maybe I'm grepping the wrong terms.

5. Related to the derby issue above. This might be a bit radical.
If we removed ALL the database drivers except perhaps the builtin h2
support, we could distribute the dhis.war + database extension. Pick
and mix and match your choice. Not sure if the benefits would be
worth the inconvenience, but it would also force us to look into
pluggable extensability.

6. reporting - we are currently doing jasper and birt. Why? I've no
doubt there's a historical rationale but I am not familiar with it.
Can we drive one direction or the other on this?

There's still a lot of unaccounted for Megabytes left but that's it
for now. Can we get under 25M? I think so.

Cheers
Bob

Hi Bob,

thanks for looking into this, very useful.

In view of the ongoing effort to refine dhis2 into the lean and mean

machine which we know is trying to break out inside of it, and also as

part of my continuing exploration of what exactly is going on, I’ve

done a bit of an analysis of the jars packaged inside the dhis.war.

(I’ve got these in a spreadsheet - should put them on the wiki or

somewhere if only I knew how.)

Listed in order of size we have:

name size cumulative

wstx-api-2.9.jar 1443 1443

acegi-security-tiger-1.0.2.jar 3091 4534

dhis-support-transaction-2.0.1-SNAPSHOT.jar 3653 8187

aopalliance-1.0.jar 4467 12654

dhis-i18n-translationstore-hibernate-2.0.1-SNAPSHOT.jar 6836 19490

dhis-i18n-upgrader-2.0.1-SNAPSHOT.jar 7181 26671

jsr107cache-1.0.jar 8277 34948

dhis-support-external-2.0.1-SNAPSHOT.jar 9416 44364

dhis-useradminandsecurity-2.0.1-SNAPSHOT.jar 9814 54178

staxwax-1.0.4.jar 10956 65134

dhis-i18n-static-2.0.1-SNAPSHOT.jar 12143 77277

dhis.jar 13419 90696

geronimo-spec-jta-1.0-M1.jar 13473 104169

dhis-i18n-db-2.0.1-SNAPSHOT.jar 15162 119331

dhis-service-user-hibernate-2.0.1-SNAPSHOT.jar 15300 134631

asm-attrs-1.5.3.jar 16757 151388

dhis-options-2.0.1-SNAPSHOT.jar 18344 169732

cave-process-1.0.3.jar 19408 189140

dhis-support-hibernate-2.0.1-SNAPSHOT.jar 20773 209913

dhis-service-organisationunit-2.0.1-SNAPSHOT.jar 22173 232086

dhis-service-administration-2.0.1-SNAPSHOT.jar 24072 256158

xpp3_min-1.1.4c.jar 24956 281114

asm-1.5.3.jar 26361 307475

stax-api-1.0.1.jar 26514 333989

commons-email-1.1.jar 30651 364640

commons-fileupload-1.1.1.jar 31909 396549

dhis-web-dashboard-integration.jar 33002 429551

dhis-support-webwork-2.0.1-SNAPSHOT.jar 34793 464344

dhis-web-maintenance-dataadmin.jar 36180 500524

dhis-web-maintenance-settings.jar 36714 537238

commons-logging-api-1.1.jar 44598 581836

commons-codec-1.3.jar 46725 628561

dhis-support-system-2.0.1-SNAPSHOT.jar 51125 679686

commons-logging-1.1.jar 52915 732601

jep-2.24.jar 56755 789356

commons-io-1.1.jar 61562 850918

dhis-service-datamart-default-2.0.1-SNAPSHOT.jar 62188 913106

activation-1.1.jar 62983 976089

oro-2.0.8.jar 65261 1041350

dhis-web-validationrule.jar 65645 1106995

dhis-web-maintenance-user.jar 73276 1180271

dhis-service-reporting-2.0.1-SNAPSHOT.jar 76962 1257233

dhis-web-datamart.jar 77406 1334639

ibatis2-common-2.1.7.597.jar 85038 1419677

velocity-tools-1.2.jar 88194 1507871

dhis-web-maintenance-dataset.jar 90226 1598097

oscore-2.2.4.jar 91078 1689175

xpp3-1.1.3.3.jar 93395 1782570

servlet-api-2.4.jar 97693 1880263

dhis-service-jdbc-2.0.1-SNAPSHOT.jar 101799 1982062

dhis-web-maintenance-organisationunit.jar 104568 2086630

xml-apis-1.0.b2.jar 109318 2195948

rife-continuations-0.0.2.jar 116956 2312904

dhis-service-core-2.0.1-SNAPSHOT.jar 126194 2439098

commons-validator-1.3.1.jar 138956 2578054

commons-digester-1.7.jar 139966 2718020

dhis-web-dataentry.jar 144245 2862265

junit-4.4.jar 161477 3023742

ognl-2.6.9.jar 167958 3191700

ognl-2.6.11.jar 168081 3359781

stax2-api-3.0.1.jar 179977 3539758

commons-beanutils-1.7.0.jar 188671 3728429

xml-apis-1.3.02.jar 194205 3922634

commons-lang-2.1.jar 207723 4130357

dhis-api-2.0.1-SNAPSHOT.jar 213598 4343955

dhis-web-commons-2.0.1-SNAPSHOT.jar 218342 4562297

ehcache-1.5.0.jar 264400 4826697

dhis-web-importexport.jar 281502 5108199

cglib-2.1_3.jar 282338 5390537

spring-core-2.5.6.jar 285491 5676028

xwork-1.2.3.jar 286284 5962312

dhis-web-maintenance-datadictionary.jar 297665 6259977

ibatis2-sqlmap-2.1.7.597.jar 304649 6564626

jcommon-1.0.14.jar 307917 6872543

dom4j-1.6.1.jar 313898 7186441

backport-util-concurrent-3.1.jar 331716 7518157

commons-math-1.2.jar 338488 7856645

log4j-1.2.12.jar 358085 8214730

dhis-web-reporting.jar 376768 8591498

mail-1.4.jar 388864 8980362

velocity-1.5.jar 392124 9372486

dhis-service-importexport-2.0.1-SNAPSHOT.jar 407408 9779894

xstream-1.3.jar 411090 10190984

antlr-2.7.6.jar 443432 10634416

acegi-security-1.0.2.jar 456993 11091409

postgresql-8.3-603.jdbc4.jar 474746 11566155

woodstox-core-asl-4.0.3.jar 481111 12047266

spring-beans-2.5.6.jar 488282 12535548

joda-time-1.5.2.jar 531326 13066874

commons-collections-3.2.jar 571259 13638133

c3p0-0.9.1.2.jar 610790 14248923

jxl-2.6.jar 660390 14909313

mysql-connector-java-5.1.6.jar 703265 15612578

freemarker-2.3.4.jar 789043 16401621

poi-2.5.1-final-20040804.jar 802216 17203837

h2-1.1.109.jar 1163608 18367445

jfreechart-1.0.11.jar 1360956 19728401

jasperreports-2.0.2.jar 1788352 21516753

itext-1.4.8.jar 1891191 23407944

hibernate-3.2.6.ga.jar 2274768 25682712

derby-10.4.2.0.jar 2446767 28129479

spring-2.5.6.jar 2949500 31078979

webwork-2.2.6.jar 3218671 34297650

jdtcore-3.1.0.jar 3555707 37853357

Total 37853357

As you see we are carrying 37M of jar around. Which sounds about

right - the dhis.war weighs in at about 35M. That’s fairly big - I’ve

got some thoughts about reducing it which I’d appreciate your comment

on. Because the above is listed by size, it makes sense to focus on

the bottom candidates as much as possible. Of the approx 38M, half of

that is taken up by the top 10 jars (out of 104 in total). The dhis*

jars (34 of them) account for about 3M which means that there are

about 60 ‘minor’ jar dependencies which together account for around

15M.

  1. jdtcore doesn’t seem to be required in a production server. Maybe

it is required for debugging in eclipse. If we take it out we get

down to a war file of 32.5M which is a 10% improvement and full

functionality (I think)

I have been thinking the same, just remove and try it out…

  1. derby - though I was the one pushing for derby support, it doesn’t

100% work, we are so far quite happy with H2 for the embedded stuff

and if we take it out of the production release we get down to 30.2M

Fine.

How to break the mystical 30M barrier …

  1. As far as I can see we are not using freemarker at all. I guess

we use velocity so it makes sense we wouldn’t use both. Take it out

and we’d be down to 29.6M

I think this comes in as a transitive dependency to webwork, try using in the POM and see what happens…

As far as I can tell these can happen right away.

Other thoughts which can’t happen right away:

  1. We should not need to have jxl and poi. Much though we love

microsoft its enough to love the buggers once. We need to dump one of

them - probably jxl - and port the existing code to the other. Am I

right in thinking we are not yet using POI - I haven’t found

references to it but maybe I’m grepping the wrong terms.

I am not using POI. Try removing the dependency and recompile the system…

  1. Related to the derby issue above. This might be a bit radical.

If we removed ALL the database drivers except perhaps the builtin h2

support, we could distribute the dhis.war + database extension. Pick

and mix and match your choice. Not sure if the benefits would be

worth the inconvenience, but it would also force us to look into

pluggable extensability.

Maybe not worth the inconvenience right now…

  1. reporting - we are currently doing jasper and birt. Why? I’ve no

doubt there’s a historical rationale but I am not familiar with it.

Can we drive one direction or the other on this?

As far as I know Jasper is used simply for the data set report function (for data sets not having a custom form). Hopefully we can simply remove this function/code, if the functionality is necessary we could rewrite it to use Itext (which is already in there).

There’s still a lot of unaccounted for Megabytes left but that’s it

for now. Can we get under 25M? I think so.

Also, in the lite package I had to add a dependency which has quite heavy transitive comrades to make BIRT work:

org.mortbay.jetty
jsp-2.1

6.1.14

Lars

···

On Thu, Apr 30, 2009 at 6:17 PM, Bob Jolliffe bobjolliffe@gmail.com wrote: