Hi all,
I have a xsl and xml file which is transformed to a particular format. I make use of the net.sf.saxon.Tr ansformerFactor yImpl to do my transformation.
I'm actually timing the transformations to see how long they take. So basically i do a transformation of a file once, ten times and then 1000 times to see how long it takes.
Basically i put a timer statement before the for loop and a timer after the for loop to find out the difference.
This is part of my code:
The timings that i get are somewhat odd.
My only only assumption why it takes 469 ms to run it once and 218ms to run it 10 times, is something to do with initializing the transformation engine??
Could anyone please shed some light?
Nitin
I have a xsl and xml file which is transformed to a particular format. I make use of the net.sf.saxon.Tr ansformerFactor yImpl to do my transformation.
I'm actually timing the transformations to see how long they take. So basically i do a transformation of a file once, ten times and then 1000 times to see how long it takes.
Basically i put a timer statement before the for loop and a timer after the for loop to find out the difference.
This is part of my code:
Code:
public static void main(String args[]) { System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl"); test(10); test(10); test(1000); } public static void test(int n){ long start=0; long end =0; start = new Date().getTime(); for (int i=0; i<n ; i++){ process(); } end = new Date().getTime(); System.out.println("No of times run-->"+n); System.out.println(end-start); }
Code:
No of times run-->1 469 No of times run-->10 218 No of times run-->1000 8468
Could anyone please shed some light?
Nitin
Comment