final Sequence<? extends Item> result = doQuery(queryFile);
MarshalledSequence serResult = new MarshalledSequence(result, DynamicContext.DUMMY);
serResult.setPiped(piped);
StopWatch sw1 = new StopWatch("SerializedSequence encoding time");
byte[] encoded = ObjectUtils.toBytes(serResult);
System.err.println(sw1);
System.err.println("encoded size: " + encoded.length + " bytes");
StopWatch sw2 = new StopWatch("SerializedSequence decoding time");
Sequence<Item> decodedSeq1 = ObjectUtils.readObjectQuietly(encoded);
System.err.println(sw2);
StopWatch sw3 = new StopWatch("IncrementalDecodedSequnece encoding time");
byte[] encoded2 = ObjectUtils.toBytes(decodedSeq1);
System.err.println(sw3);
StopWatch sw4 = new StopWatch("IncrementalDecodedSequnece decoding time");
Sequence<Item> decodedSeq2 = ObjectUtils.readObjectQuietly(encoded2);
System.err.println(sw4);
MarshalledSequence reaccessed2 = (MarshalledSequence) decodedSeq2;
reaccessed2.setReaccessable(true);
// partial decode
Iterator<Item> itor2 = decodedSeq2.iterator();
for(int i = 0; i < 75; i++) {
itor2.next();
}
StopWatch sw5 = new StopWatch("IncrementalDecodedSequnece (partially decoded: 100 items) encoding time");
byte[] encoded3 = ObjectUtils.toBytes(decodedSeq2);
System.err.println(sw5);
StopWatch sw6 = new StopWatch("IncrementalDecodedSequnece (partially decoded: 100 items) decoding time");
Sequence<Item> decodedSeq3 = ObjectUtils.readObjectQuietly(encoded3);
MarshalledSequence reaccessed3 = (MarshalledSequence) decodedSeq3;
reaccessed3.setReaccessable(true);
System.err.println(sw6);
// full decode
int count1 = 0;
for(Item it : decodedSeq3) {
count1++;
}
StopWatch sw7 = new StopWatch("!IncrementalDecodedSequnece (full decoded) encoding time");
byte[] encoded4 = ObjectUtils.toBytes(decodedSeq3);
System.err.println(sw7);
StopWatch sw8 = new StopWatch("!IncrementalDecodedSequnece (full decoded) decoding time");
Sequence<Item> decodedSeq4 = ObjectUtils.readObjectQuietly(encoded4);
System.err.println(sw8);
int count2 = 0;
for(Item it : decodedSeq4) {