@@ -0,0 +1,1517 @@
+package ca.uhn.fhir.jpa.stresstest;%0A%0Aimport ca.uhn.fhir.context.FhirContext;%0Aimport ca.uhn.fhir.test.BaseTest;%0Aimport ca.uhn.fhir.util.StopWatch;%0Aimport org.hl7.fhir.instance.model.api.IBaseResource;%0Aimport org.hl7.fhir.r4.model.Bundle;%0Aimport org.junit.Test;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport java.io.IOException;%0A%0Apublic class StressTestParserTest extends BaseTest %7B%0A%0A%09private static final Logger ourLog = LoggerFactory.getLogger(StressTestParserTest.class);%0A%0A%09@Test%0A%09public void test() throws IOException %7B%0A%09%09FhirContext ctx = FhirContext.forR4();%0A%09%09String input = loadResource(%22/org/hl7/fhir/r4/model/valueset/valuesets.xml%22);%0A%0A%09%09String json = ctx.newJsonParser().encodeResourceToString(ctx.newXmlParser().parseResource(input));%0A%0A%09%09StopWatch sw = null;%0A%09%09int loops = 100;%0A%0A%09%09for (int i = 0; i %3C loops; i++) %7B%0A%09%09%09ctx.newXmlParser().parseResource(input);%0A%09%09%09if (i %3C 50) %7B%0A%09%09%09%09ourLog.info(%22Parsed XML %7B%7D times%22, i);%0A%09%09%09%09continue;%0A%09%09%09%7D else if (i == 50) %7B%0A%09%09%09%09sw = new StopWatch();%0A%09%09%09%09continue;%0A%09%09%09%7D%0A%09%09%09ourLog.info(%22Parsed XML %7B%7D times - %7B%7Dms/pass%22, i, sw.getMillisPerOperation(i - 50));%0A%09%09%7D%0A%0A%09%09for (int i = 0; i %3C loops; i++) %7B%0A%09%09%09Bundle parsed = (Bundle) ctx.newJsonParser().parseResource(json);%0A%09%09%09if (i %3C 50) %7B%0A%09%09%09%09ourLog.info(%22Parsed JSON with %7B%7D entries %7B%7D times%22, parsed.getEntry().size(), i);%0A%09%09%09%09continue;%0A%09%09%09%7D else if (i == 50) %7B%0A%09%09%09%09sw = new StopWatch();%0A%09%09%09%09continue;%0A%09%09%09%7D%0A%09%09%09ourLog.info(%22Parsed JSON %7B%7D times - %7B%7Dms/pass%22, i, sw.getMillisPerOperation(i - 50));%0A%09%09%7D%0A%0A%0A%09%7D%0A%7D%0A

Add parser stress test