Opened 5 months ago

Closed 3 months ago

#25699 closed enhancement (fixed)

Make `ant war` run faster and the resulting .war file smaller

Reported by: karsten Owned by: karsten
Priority: Low Milestone:
Component: Metrics/Website Version:
Severity: Normal Keywords:
Cc: metrics-team Actual Points:
Parent ID: Points:
Reviewer: iwakeh Sponsor:

Description

A couple months back (commit ccbcb09), before we switched to embedded Jetty (#24175), creating the .war file ran much faster and produced a much smaller .war file than it does now: 4 seconds and 9.6M

After we switched to embedded Jetty (commit 940e00c), this changed: 71 seconds, 18M

Today, after including Relay Search (cf. #25392 and child), it takes a tiny bit longer and produces an even larger .war file: 73 seconds, 27M

Is there an easy way to improve both, performance and size?

Child Tickets

Change History (10)

comment:1 Changed 4 months ago by iwakeh

Owner: changed from metrics-team to iwakeh
Status: newaccepted

comment:2 Changed 4 months ago by iwakeh

Update:
Ticket's #25392 start of an integration branch (see comment 5 there) reduces the war-file size to 19M and duration to 28sec, where the latter is not really comparable as I'm using a different machine.

comment:3 Changed 4 months ago by karsten

I think I found something: I just added commons-math3-3.6.1.jar (2.1M) to the libs for an unrelated experiment, and the effect on ant war (which doesn't even use that lib in my experiment) was that it took 97 seconds as compared to 66 seconds without that lib.

So, a quick fix might be to look closer which libraries are required in the .war file. For example, we could easily remove postgresql-9.4.1212.jar (636K) from the .war and only use it in the .jar. I didn't look much further, but maybe there are other libraries we can avoid including in the .war.

comment:4 Changed 4 months ago by iwakeh

Yes, everything that is not included helps!

comment:5 Changed 3 months ago by karsten

Owner: changed from iwakeh to karsten

I'm briefly looking a bit more into this. Will get back here with results this afternoon. Temporarily stealing the ticket.

comment:6 Changed 3 months ago by karsten

Status: acceptedneeds_review

Please review two commits e4c0404 and 786fae5 in my task-25699 branch. It doesn't help much, but at least a little bit.

What we should do in the future is that we watch out for new libraries that we only need for the stats part. For example, Apache Commons Math. Just something to keep in mind.

Not sure if there's more to do here. Happy to give this ticket back after these two commits are reviewed, possibly revised, and merged.

comment:7 Changed 3 months ago by iwakeh

Reviewer: iwakeh

comment:8 Changed 3 months ago by karsten

Priority: MediumLow

comment:9 Changed 3 months ago by iwakeh

All ant tests and checks pass. On my machine the war-building time is at 43 sec. So, looking further into a tight RS integration as mentioned in comment:2 would still help.

Please adjust the status as needed.

comment:10 Changed 3 months ago by karsten

Resolution: fixed
Status: needs_reviewclosed

Great, thanks for checking! Merged to master. Closing, because we did what we could and there's always more to do. Thanks!

Note: See TracTickets for help on using tickets.