Click here to Skip to main content
15,909,324 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC help!!! Pin
GegoTheWizard2-Mar-04 9:23
GegoTheWizard2-Mar-04 9:23 
GeneralRe: MFC help!!! Pin
David Crow2-Mar-04 9:23
David Crow2-Mar-04 9:23 
GeneralRe: MFC help!!! Pin
modeonetwo2-Mar-04 12:43
modeonetwo2-Mar-04 12:43 
GeneralTrying to create static splitter... Pin
Nat292-Mar-04 7:41
Nat292-Mar-04 7:41 
GeneralRe: Trying to create static splitter... Pin
Antti Keskinen2-Mar-04 8:24
Antti Keskinen2-Mar-04 8:24 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 9:15
Nat292-Mar-04 9:15 
GeneralRe: Trying to create static splitter... Pin
David Crow2-Mar-04 9:27
David Crow2-Mar-04 9:27 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 10:34
Nat292-Mar-04 10:34 
GeneralRe: Trying to create static splitter... Pin
David Crow2-Mar-04 10:37
David Crow2-Mar-04 10:37 
GeneralRe: Trying to create static splitter... Pin
Nat292-Mar-04 11:22
Nat292-Mar-04 11:22 
GeneralGetting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 5:55
Vikram A Punathambekar2-Mar-04 5:55 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 6:58
professionalRavi Bhavnani2-Mar-04 6:58 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 7:05
Vikram A Punathambekar2-Mar-04 7:05 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 7:47
professionalRavi Bhavnani2-Mar-04 7:47 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 7:34
Vikram A Punathambekar2-Mar-04 7:34 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 7:50
professionalRavi Bhavnani2-Mar-04 7:50 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 8:22
professionalRavi Bhavnani2-Mar-04 8:22 
GeneralRe: Getting content from HTML control Pin
Vikram A Punathambekar2-Mar-04 9:32
Vikram A Punathambekar2-Mar-04 9:32 
GeneralRe: Getting content from HTML control Pin
Ravi Bhavnani2-Mar-04 11:17
professionalRavi Bhavnani2-Mar-04 11:17 
GeneralRe: Getting content from HTML control Pin
David Crow2-Mar-04 7:29
David Crow2-Mar-04 7:29 
GeneralWriting large STL vectors to file Pin
inter8ection2-Mar-04 5:52
inter8ection2-Mar-04 5:52 
Hi, I am trying to write/read a large vector of vector of doubles to comma delimited text file using std::ofstream. The problem is that it doesn't seem to be very fast, taking a few minutes at a time.

The matrix to be written/read is of the size N x M, where N is approx. 2,000 and M is between 1,000 and 40,000. That means a file size of up to approx. 800Mb for M == 40,000.

Should I consider serialization as something that might be faster?

At the moment I am not doing anything complicated, below is my code for writing the 'spreads' matrix to file (removed conditional error checks, etc):


ofstream write_file;

write_file.open(fileName.c_str(), ios_base::out | ios_base::trunc );

int numRows = spreads.size();
int numCols = spreads[0].size();

for (int row = 0; row < numRows; row++)
{
for (int col = 0; col < numCols; col++)
{
write_file << "," << spreads[row][col];
}
write_file << endl;
}

write_file.close();


When reading it in I do much the same thing, reading in the file line by line and using a split string algorithm to extract each row of doubles, building up the matrix of doubles.

The CPU is at 100% at all times when this is run, so it's not slow file I/O that's the problem.

Any suggestions would be appreciated.

Thanks,
Christopher

The bomb lives only as it is falling
GeneralRe: Writing large STL vectors to file Pin
valikac2-Mar-04 18:06
valikac2-Mar-04 18:06 
GeneralRe: Writing large STL vectors to file Pin
inter8ection2-Mar-04 23:51
inter8ection2-Mar-04 23:51 
GeneralRe: Writing large STL vectors to file Pin
Robert A. T. Káldy3-Mar-04 1:18
Robert A. T. Káldy3-Mar-04 1:18 
GeneralQuestion using CHttpFile class. Pin
Chris Meech2-Mar-04 5:51
Chris Meech2-Mar-04 5:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.