This sample is a complete distribution of the Windward Reports Java Engine that will run reports in a multithreaded capacity.
The purpose of this example is to give code that enables a user to run a multithreaded test in their native environment to get a true benchmark of how Windward will perform. The general rule taken into account when determining the maximum number of threads to run simultaneously is to never exceed more than double the number of available CPU cores. For example if the target system has 2 physical chips that are dual core then there are actually 4 cores available. This would mean that a maximum of 8 threads should be utilized. The number of threads used is calculated in RunBatchReport.java with the following code. It queries the host operating system for the total number of cores and multiplies it by 2.
// how many threads to run (generally 2X the number of processors)
final int NUM_THREADS = rt.availableProcessors() * 2;
|System||2 core system - 2 Gb RAM||8 core system - 32 Gb RAM|
|Memory||2 GB||32 GB|
|Processor||2 cores - 2.80 GHz||8 cores - 2.27 GHz|
|Number of Threads||4||16|
|Number of Reports Generated||10,000||10,000|
|Total Number of Pages||10,000||10,000|
|Total Time||16 minutes 8.32 seconds||6 minutes 53.31 seconds|
|Pages Per Second||~ 10 pages/second||~ 24 pages/second|
|Memory Used||13.57 MB||2.38 GB|
Running the code
- Download and extract the ZIP file to a directory on your system. Windward assumes that java is included in your path and is globally available to call from anywhere on the system. If this is not the case please extract to a place where Java is available or add the java command to your local path.
- Open a command prompt and navigate to the directory where you extract your files
- Update the WindwardReports.properties file with a valid license key on the license= line in that file.
- Run run.bat as follows for a simple test to ensure the engine is running. This will run the sample template and data source to create PDF output consisting of one file starting with rpt.
- PROMPT>run.bat PDF 1
- Next open run_all.bat and adjust for the performance metrics you wish to test on the target system. Adjusting the last 2 parameters defines the OUTPUT_TYPE and NUMBER_OF_REPORTS_TO_CREATE
- Run run_all.bat to start the test
This was run on a 2 core system producing 300 PDF reports. Elapsed time was 1 minute 12.745 seconds
- 2009 Manufacturing Report - Template.docx
- 2009 Manufacturing Report - Data.xml
- run.bat - deletes all files starting with rpt* and call java RunBatchReport accepting the following paramters: TEMPLATE_NAME XML_FILENAME OUTPUT_TYPE NUMBER_OF_REPORTS_TO_CREATE
- run_all.bat - calls run.bat and passes in the last 2 parameters OUTPUT_TYPE NUMBER_OF_REPORTS_TO_CREATE