|
|
|
|
|
Re: Pre-Caching Enhacement - MDHT [message #1728702 is a reply to message #1728259] |
Wed, 06 April 2016 14:04 |
Raj Mehra Messages: 7 Registered: February 2016 |
Junior Member |
|
|
Sean, as per the recommendation, made change to call all the methods. Attached the class file that does the pre-loading of sections. Performance issue is still there and looks it got a little worse with the pre-loading of all the sections. The subsequent validation of the same document is still better with/without pre-loading the sections.
Input Document has below sections -
Allergies
Medications
Problem List
Procedures
Results
Advance Directives
Encounters
Family History
Functional Status
Immunizations
Medical Equipment
Payers
Plan of Care
Social History
Vital Signs
Timings with preloading sections - document - with heap size 512M. Same document validated multiple times in same process
Time in preload sections = 37.732
Time in seconds to create consolepackage instance = 0.001
1st validation - Time in seconds to load the document = 27.461
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
2nd validation - Time in seconds to create consolepackage instance = 0.0
Time in seconds to load the document = 0.17
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
3rd Validation - Time in seconds to create consolepackage instance = 0.0
Time in seconds to load the document = 0.145
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
Without preloading sections - Same document validated multiple times in same process.
1st validation - Time in seconds to create consolepackage instance = 1.083
Time in seconds to load the document = 10.042
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
2nd Validation - Time in seconds to create consolepackage instance = 0.0
Time in seconds to load the document = 0.189
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
3rd Validation - Time in seconds to create consolepackage instance = 0.0
Time in seconds to load the document = 0.175
Number of Schema Validation Diagnostics: 0
Number of EMF Resource Diagnostics: 0
Number of EMF Validation Diagnostics: 281
Number of Total Diagnostics: 281
Source code to execute the validation-
public static void main(String[] args){
CCDAValidator val = new CCDAValidator();
double startTime = System.currentTimeMillis();
PreLoadSections.loadSections();
System.out.println("Time in preload sections = "+ (System.currentTimeMillis() - startTime)/1000);
val.validate("ccda_doc.xml");
val.validate("ccda_doc.xml");
val.validate("ccda_doc.xml");
val.validate("ccda_doc.xml");
val.validate("ccda_doc.xml");
val.validate("ccda_doc.xml");
}
public void validate(String docName) {
double startTime = System.currentTimeMillis();
ConsolPackage.eINSTANCE.eClass();
System.out.println("Time in seconds to create consolepackage instance = "+ (System.currentTimeMillis() - startTime)/1000);
InputStream cpResource = Thread.currentThread().getContextClassLoader().getResourceAsStream(docName);
// CCDPackage.eINSTANCE.eClass(); //Deprecated now and is replaced with ConsolPackage
try {
ValidationResult valResult = new ValidationResult();
//This method performs schemaValidation and CCD Document Validation
//Populates the errors, warnings & information messages in ValidationResult
startTime = System.currentTimeMillis();
ClinicalDocument ccdDocument = (ClinicalDocument) CDAUtil.load(cpResource, valResult);//Loads CDADocument.
System.out.println("Time in seconds to load the document = "+ (System.currentTimeMillis() - startTime)/1000);
System.out.println("Number of Schema Validation Diagnostics: " + valResult.getSchemaValidationDiagnostics().size());
System.out.println("Number of EMF Resource Diagnostics: " + valResult.getEMFResourceDiagnostics().size());
System.out.println("Number of EMF Validation Diagnostics: " + valResult.getEMFValidationDiagnostics().size());
System.out.println("Number of Total Diagnostics: " + valResult.getAllDiagnostics().size());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (cpResource!= null){
try {
cpResource.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
[Updated on: Wed, 06 April 2016 14:06] Report message to a moderator
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05838 seconds