measure execution time of XSLT 2.0 program in mapForce

202 views Asked by At

I am using Altova Mapforce to generate output from XSLT 2.0. I want to know how much time it took to execute the program.

I intend to compare this execution time with the time taken by C++ to do the same work. I want to know which is one faster, C++ or the XSLT Engine for this particular task.

By the way, in XSLTProc I found a --timing option which tells me the time but XSLTProc only accepts XSLT 1.0 so I can't use it for my program.

Any help will be appreciated.

1

There are 1 answers

0
keshlam On

I don't know anything about mapForce, so this will be a rather generic answer...

If you are invoking this from the command line, many operating systems provide a tool which will check system time before and after executing a command line and report the difference with some reasonable degree of accuracy. In Linux or Unix, it's called "time"; I don't know what's recommended elsewhere.

If you can't find or download that tool, or if you're invoking this through an API, you can write your own version of that -- check the system's millisecond or nanosecond clock (which is a standard library call), invoke the thing you want to test (if necessary, run a shell to invoke it from the command line, otherwise invoke it directly), get the system clock again, subtract the two and report time taken.

If your XSLT system supports it, you may want to time stylesheet compilation and stylesheet execution separately, since compilation is a one-time cost if you expect to reuse that stylesheet.