Click here to Skip to main content
15,898,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
GeneralWindows XP Theme Conflict Pin
Jnewg52-Mar-04 5:29
Jnewg52-Mar-04 5:29 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn2-Mar-04 9:01
sitebuilderMichael Dunn2-Mar-04 9:01 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg53-Mar-04 5:36
Jnewg53-Mar-04 5:36 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn3-Mar-04 6:41
sitebuilderMichael Dunn3-Mar-04 6:41 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg511-Mar-04 3:14
Jnewg511-Mar-04 3:14 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 4:28
sitebuilderMichael Dunn12-Mar-04 4:28 
GeneralRe: Windows XP Theme Conflict Pin
Jnewg512-Mar-04 15:22
Jnewg512-Mar-04 15:22 
GeneralRe: Windows XP Theme Conflict Pin
Michael Dunn12-Mar-04 16:45
sitebuilderMichael Dunn12-Mar-04 16:45 
Generalprinting your source code Pin
BlackDice2-Mar-04 5:28
BlackDice2-Mar-04 5:28 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:05
John M. Drescher2-Mar-04 6:05 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:16
BlackDice2-Mar-04 6:16 
GeneralRe: printing your source code Pin
John M. Drescher2-Mar-04 6:54
John M. Drescher2-Mar-04 6:54 
GeneralRe: printing your source code Pin
BlackDice2-Mar-04 6:58
BlackDice2-Mar-04 6:58 

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.