public void performance() throws Exception
{
final XsltAction action = new XsltAction(new ConfigBuilder().resultType(ResultType.STRING).templateFile(TEST_XSL_1).build());
action.initialise();
final MessageFactory messageFactory = MessageFactory.getInstance();
Message processed = null;
// warm up
for (int i = 0; i < 50000; i++)
{
final Message message = messageFactory.getMessage();
final String xml = "<a><b><c><b></b></c></b></a>";
message.getBody().add(xml);
processed = action.process(message);
}
final int iterations = 1000000;
final long start = System.nanoTime();
for (int i = 0; i < iterations; i++)
{
final Message message = messageFactory.getMessage();
final String xml = "<a><b><c><b></b></c></b></a>";
message.getBody().add(xml);
processed = action.process(message);
}
final long duration = System.nanoTime() - start;