Difference in execution speeds when run on different machines
<p>I am running the below program on 2 different machines with different architectures. The practice in our organization is to build the executable in New York machine and copy it to Singapore machine. </p>

<p>Below is the architecture in New York and Singapore Machine.</p>

<p>New York:
SunOS pns15a-5203a 5.10 Generic_137111-04 sun4u sparc SUNW,Sun-Fire-V440  </p>

<p>Singapore:
SunOS sgs75a-5201b 5.10 Generic_137111-04 sun4v sparc SUNW,SPARC-Enterprise-T5220</p>

<pre><code>#include &lt;cstdio&gt;
#include &lt;sys/time.h&gt;
#include &lt;cstdlib&gt;
#include &lt;unistd.h&gt;
#include &lt;cstring&gt;

using namespace std;


int main (int argc, char **argv)
{
        char **p;
        int num_allocations = atoi(argv[1]);

        clock_t start = clock();

        p =  new char* [num_allocations];

        clock_t end1 = clock();

        for (int ii=0; ii&lt; num_allocations; ii++)
        {
                p[ii] = new char [num_allocations];
                memset (p[ii], sizeof(char)*num_allocations, '\0');
        }

        clock_t end2 = clock();


        for (int ii=0; ii&lt; num_allocations; ii++)
        {
                delete[] p[ii];
        }
        delete[] p;

        printf("Time Taken for allocations(%d) = %lf seconds for initialization %.2f seconds \n", num_allocations, (double)(end1 - start)/CLOCKS_PER_SEC, (double)(end2 - end1)/CLOCKS_PER_SEC);

}
</code></pre>

<p>I am running the program for different char sizes.</p>

<blockquote>
  <p>./run_test.csh</p>
</blockquote>

<pre><code>#!/bin/csh -f -x

./a.out 1
./a.out 1024
./a.out 2048
./a.out 4096
./a.out 8192
./a.out 16384
</code></pre>

<p>The output for Newyork and Singapore machine is given below.</p>

<p><strong>New York Machine:</strong><br>
Time Taken for allocations(1) = 0.000000 seconds for initialization 0.00 seconds<br>
Time Taken for allocations(1024) = 0.000000 seconds for initialization 0.00 seconds<br>
Time Taken for allocations(2048) = 0.000000 seconds for initialization 0.01 seconds<br>
Time Taken for allocations(4096) = 0.000000 seconds for initialization 0.03 seconds<br>
Time Taken for allocations(8192) = 0.000000 seconds for initialization 0.11 seconds<br>
Time Taken for allocations(16384) = 0.000000 seconds for initialization 0.37 seconds  </p>

<p><strong>Time Taken for Singapore Machine:</strong></p>

<p>Time Taken for allocations(1) = 0.000000 seconds for initialization 0.00 seconds<br>
Time Taken for allocations(1024) = 0.000000 seconds for initialization 0.00 seconds<br>
Time Taken for allocations(2048) = 0.000000 seconds for initialization 0.02 seconds<br>
Time Taken for allocations(4096) = 0.000000 seconds for initialization 0.05 seconds<br>
Time Taken for allocations(8192) = 0.000000 seconds for initialization 0.18 seconds<br>
Time Taken for allocations(16384) = 0.000000 seconds for initialization 0.53 seconds  </p>

<p>How do I start investigating the issue ?</p>
