Hi all,
I have written the following program and run on both T5440 [1.4 GHz, 95 GB RAM, 32 cores(s), 256 logical (virtual) processor(s),] and T5220 [(UltraSPARC-T2 (chipid 0, clock 1165 MH) , 8GB RAM, 1 core, 8 virtual processors )] on same OS version. I found that T5540 server takes more time than T5220. Please find below the details.
test1.cpp
#include <iostream>
#include <pthread.h>
using namespace std;
#define NUM_OF_THREADS 20
struct ABCDEF {
char A[1024];
char B[1024];
};
void *start_func(void *)
{
long long i = 6000;
while(i--)
{
ABCDEF* sdf = new ABCDEF;
delete sdf;
sdf = NULL;
}
return NULL;
}
int main(int argc, char* argv[])
{
pthread_t tid[50];
for(int i=0; i<NUM_OF_THREADS; i++)
{
pthread_create(&tid, NULL, start_func, NULL);
cout<<"Creating thread " << i <<endl;
}
for(int i=0; i<NUM_OF_THREADS; i++)
{
pthread_join(tid, NULL);
cout<<"Waiting for thread " << i <<endl;
}
}
After executing the above program on T5440 takes :
real 0.78
user 3.94s
sys 0.05
After executing the above program on T5220 takes :
real 0.23
user 1.43s
sys 0.03
It seems that T5440 which is high end server takes almost 3 times more time than T5220 which is low end server.
However, I have one more observation. I tried the following program :
test2.cpp
#include <iostream>
#include <pthread.h>
using namespace std;
#define NUM_OF_THREADS 20
struct ABCDEF {
char A[1024];
char B[1024];
};
int main(int argc, char* argv[])
{
long long i = 6000000;
while(i--)
{
ABCDEF* sdf = new ABCDEF;
delete sdf;
sdf = NULL;
}
return 0;
}
It seems that T5440 server is fast in this case as compaired to T5220 server.
Could anyone please help me out the exact reason for this behaviour as my application is slow as well on this T5440 server.
Thanks in advance !!!
regards,
Sanjay