NOTE: This guide is a draft.
In this guide we provide tips on how to increase the performance of Smooks. Like with a lot of Software, wen treated wrong, Smooks can have a terrible performance. Wen treated right Smooks performance can increase dramatically.
This guide is written with Smooks 1.1 in mind. However most tips probably also apply to older versions of Smooks.
Table Of Contents
This part gives some performance tips of the Smooks core itself.
- Reuse the Smooks Object. Initialization of Smooks takes some time and there for it is important that it is reused.
- Don't use the HTMLReportGenerator only during development. Wenn using Smooks in production it should be deactivated. The HTMLReportGenerator takes a lot of performance and with large message can cause OutOfMemory exceptions.
- If possible use the SAX stream processor. However you need to look if all the cartridges that you use are SAX compatible. SAX processing is a lot faster then DOM and has a consistent small memory footprint. It is mandatory for processing large messages. (TODO: Explain how to activate it)
Every cartridge can have its own performance optimizing tips.
- If possible don't use the Virtual Bean Model. Create Beans instead of maps. Creating and adding data to Maps is a lot slower the creating simple POJO's and calling the setter methods.