Packet analysis: WinXP vs. Linux<->VMS shows dramatic
differ ences
BG - Ben Armstrong
BArmstrong at dymaxion.ca
Wed Sep 22 18:22:48 GMT 2004
On Wed, 2004-09-22 at 15:59 +0200, COLLOT Jean-Yves wrote:
> Another way
> to say is: according to me, the "WinXP vs. Linux<->VMS shows dramatic
> differences" topic is true only when using "ruby". Could someone tell me if
> I am right or wrong here?
We ported the ruby script to C++. I'm in the process of running tests,
capturing output, and analyzing it as I did before. Expect results
soon ...
What I can tell you so far is only that the C++ test runs fine on Linux
-> OpenVMS with performance figures similar to the Ruby test.
See samba_test.cpp below:
Ben
-- cut here --
#include <cerrno>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <string>
#include <ctime>
using namespace std;
int main(int argc, char * argv[]) {
time_t startTime, endTime;
char drive[50];
long int blocks = 10000, blocksize = 1024;
switch (argc) {
case 1:
strcpy(drive, "S:\\");
break;
case 2:
strcpy(drive, argv[1]);
break;
case 3:
strcpy(drive, argv[1]);
blocks = strtol(argv[2], NULL, 10);
if (errno == ERANGE) {
cout << "Invalid # of blocks: " << argv[2] << endl;
cout << " Default of 10000 used." << endl;
blocks = 10000;
}
break;
case 4:
strcpy(drive, argv[1]);
blocks = strtol(argv[2], NULL, 10);
if (errno == ERANGE) {
cout << "Invalid blocks # used: " << argv[2] << endl;
cout << " Default of 10000 used." << endl;
blocks = 10000;
}
blocksize = strtol(argv[3], NULL, 10);
if (errno == ERANGE) {
cout << "Invalid blocksize # used: " << argv[2] << endl;
cout << " Default of 1024 used." << endl;
blocksize = 1024;
}
break;
default:
cout << "Usage: samba_test.exe {drive {blocks {blocksize}}}" << endl;
}
cout << "Generating stats with the following arguments:" << endl;
cout << "Drive: " << drive << endl;
cout << "Blocks: " << blocks << endl;
cout << "Blocksize: " << blocksize << endl;
char * data;
data = new char[blocksize];
memset(data, ' ', blocksize);
char dataFile[60];
strcpy(dataFile, drive);
strcat(dataFile, "BENCH.TMP");
ofstream fout;
time(&startTime);
fout.open(dataFile);
if (fout.bad()) {
cout << "Error opening the data file" << endl;
}
for (int i=0; i < blocks; i++) {
fout << data << endl;
}
fout.close();
remove(dataFile);
time(&endTime);
long int elapsed_time = (long) difftime(endTime, startTime),
bytesOut = blocks * blocksize;
cout << "On drive " << drive << " time to write " << bytesOut <<
" bytes = " << elapsed_time << " seconds." << endl;
delete [] data;
return 0;
}
-- cut here --
More information about the samba-vms
mailing list