3

As the title says, I'm experiencing very poor performance of the printf call in our code. It's used pretty extensivly for debugging purposes and hasn't caused an issue for the most part, but when I brought our code up on my new laptop (17" Macbook Pro 2011) under Windows 7 Professional 64 bit it slows down everything. I profiled the app with VerySleepy and sure enough it is the printf call that is causing the slow down, but I cannot for the life of me figure out why.

My original thought was that I was running a 32 bit app under a 64 bit os, but I'm not the only one in the office running Windows 7 64 bit (not sure the exact version of the others)

Any insight would be greatly appreciated.

EDIT: forgot to mention I'm using Visual Studio 2008 Professional

Rob Rau
  • 31
  • 1
  • `printf` has always been a slow performer on every version of C and C++ that I'm aware of. Have you compared it to a 32-bit version for example? – Mark Ransom Jun 17 '11 at 16:11
  • @Rob - my response about checking drivers was prompted by your note that you are runing Win7 on a Mac. There may be some hardware virtualization here that is killing your perf to disk or screen? A bit of a 'hail mary', I confess. – Steve Townsend Jun 17 '11 at 16:31
  • @Steve: I don't think it's a "Hail Mary" - I've run console apps on machines with poor video drivers, and the abysmal performance can be beyond belief. – Michael Burr Jun 17 '11 at 16:51
  • @Michael - me too. The Win7 on Mac aspect makes me esp. suspicious of dirver issues, whether output is to screen or redirected to mass storage. – Steve Townsend Jun 17 '11 at 16:52
  • Are you directing the output of `printf` to screen or disk? – Robᵩ Jun 17 '11 at 17:10
  • Yes it's printing to screen, so I'll check on the video drivers, but IIRC I had issues doing that cause it was a macbook pro or some such bull. I'll try it again. Thanks – Rob Rau Jun 17 '11 at 17:47

1 Answers1

4

Make sure you got the latest and greatest graphics processor drivers on your box. If your printfs go to screen then bad drivers will kill performance.

Steve Townsend
  • 53,498
  • 9
  • 91
  • 140