Monday, March 31, 2014

optimization on Java application

I wrote an application to compare the instruments across many different systems. It needed 6 to 7 minutes to run at the beginning.
After the optimazation, the runtime is cut to 22 seconds. There are three methods used to optimize the application:
1. Use indexed collection (google cqengine) instead of looping the collection
It needs more than 30 seconds for 30 million loops, after the update, it only needs 1 or 2 seconds.
2. Set -Xms -Xmx to allocate more memory for this Java application.
3. At the beginning, the csv report file is saved to clob directly. Now since it's more than 10 megabytes, it needs 6 to 8 seconds to insert.
After zip/save to blob, it's less than 1 seconds including the zip time.

No comments:

Post a Comment