1

I'm analyzing some high resolution midi data. I'm writing it to the stdout but since there is so much data coming in it takes seconds for them all to display after I did the actual action.

Currently this line writes to the commandline:

std::vector<unsigned char> message;
...
printf("W 1 = %03d, W 2 = %03d, W 3 = %03d \n",(int)message[2],(int)message2[1],(int)message2[2]);
Hedge
  • 16,142
  • 42
  • 141
  • 246
  • 1
    How fast can you read? By which I mean, do you really need to display everything that you are displaying to the command window rather than just the "important" stuff? – CB Bailey Aug 19 '11 at 07:39
  • 1
    why not write to a file? Then analyse the file at your heart's content? I would second Charles, push only the critical stuff the console... – Nim Aug 19 '11 at 07:55
  • 2
    For the record, writing to stdout *is* writing to a file. The program doesn't know whether it ends up on the console or whether it's redirected to a file or piped to some other process. – Frerich Raabe Aug 19 '11 at 08:02

2 Answers2

5

There's a good chance that this is a video driver issue - video card manufacturers probably don't always pay a lot of attention to console window performance. I've had rigs with painfully slow - I mean tooth-extraction painful - console windows that had probably 100 times improvement in that area by updating the video driver.

Michael Burr
  • 333,147
  • 50
  • 533
  • 760
  • Wow, that was a genius idea. I'm running a bitcoin-miner which uses 100% of the GPU-performance. After altering its agression it works fine now. – Hedge Aug 19 '11 at 08:04
  • wow dint know that.. something that goes to my knowledge bank.. thanks @michael – Baz1nga Aug 19 '11 at 09:16
0

why dnt you use a string builder class like this one here and append all your output string and write to the output at the end?

What do you think?

Community
  • 1
  • 1
Baz1nga
  • 15,485
  • 3
  • 35
  • 61
  • If data is created faster then it is printed I definitely would save it using one thread and print it somewhere using a second thread... – Pedro Ferreira Aug 19 '11 at 07:57
  • @zzzz, oops, I didn't follow the link! :( I saw the title (and forgot that SO strips the ++, so it looked like a c-equivalent...) doh! – Nim Aug 19 '11 at 08:09