On Fri, 22 Oct 2010, William L. Thomson Jr. wrote:

java-config --help

        Python          C
real    0m0.645s        0m0.002s
user    0m0.080s        0m0.000s
sys     0m0.040s        0m0.000s

I have not run the test myself, but I suspect that the majority of the time being spent during the Python trial is being spent in the startup and shutdown of the python interpretter. I would not expect the time spent executing the actual Python scripting to be the cause of such slow performance. An apples-to-apples comparison on the performance would be to perform something like the following for both Python and C:

struct timeval startTime, endTime;
gettimeofday(&startTime, NULL);
for (int i=0; i <= largeNum; ++i)
{
        /* Perform task to be profiled */
} gettimeofday(&endTime, NULL);
/* Output the result of endTime - startTime */

This eliminates the time overhead of the startup and shutdown of the process and only measures the actual work. Or, you could compile the binary with -pg and run gprof on the resulting call graph to get a more accurate picture.

You are right that the scripted version will be slower, but it won't be anywhere near as slow as the numbers of your test suggest.

Andrew

---------------------------------------------------------------------
Archive      http://marc.info/?l=jaxlug-list&r=1&w=2
RSS Feed     http://www.mail-archive.com/[email protected]/maillist.xml
Unsubscribe  [email protected]

Reply via email to