public class XMLMarshallerProfiler
{
public static void profileMarshaller() throws IOException
{
Request req = new Request();
List instanceList = new ArrayList();
int nIterations = 0xffff;
int nWarmup = nIterations * 4; // 80%
int nSizeMultiplier = 5; // ~50k chars
for (int i = 0; i < nSizeMultiplier; ++i)
{
// create argument transfer object
req.addInvocation(sizedTransferObject("arg", i, nSizeMultiplier), new Pair("pair" + i));
// create filter transfer object
// (don't reuse arg because SOAP can map same object to multiple places,
// XML can't and hence skews results)
req.addFilter(sizedTransferObject("filter", i, nSizeMultiplier));
// create instance transfer object
// (don't reuse arg because SOAP can map same object to multiple places,
// XML can't and hence skews results)
instanceList.add(sizedTransferObject("instance", i, nSizeMultiplier));
}
TransferObject instancesFilter = new TransferObject();
instancesFilter.setValue("instances", instanceList);
req.addFilter(instancesFilter);
final long[] counterArray = new long[1];
Writer writer = new Writer() {
public void close() {}
public void flush() {}