0

I have a cygwin application (a game: http://te4.org) that I want to profile to figure out why it's so slow on one of my machines. Since cygwin doesn't produce PDB files, the usual Windows-profiling suspects need not apply.

What's the state of the art for this sort of thing? I haven't found many encouraging things about using gprof (requiring custom libraries to be dropped in, etc.), but I'll go there if I have to.

shaver
  • 157
  • 9
  • [This method](http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux/378024#378024) might not be easy to do, but it should tell you what the problem is. – Mike Dunlavey Oct 04 '11 at 17:24
  • Yeah, the problem is that I want to profile something that's interactive, so flipping back and forth to gdb at the right time is going to be a serious pain. I've done that sort of sampling before (esp for application hangs), though, and it does indeed work if you're able to manage the timing. Thanks for the reminder. – shaver Oct 05 '11 at 14:09
  • Yeah, what I do then is slow down the interactive code by either 1) putting a loop around it, or 2) in the debugger, create a data-change-watch. This puts the debugger into emulation mode, 1 or 2 orders of magnitude slower than normal, which does the same thing as "speeding me up". Then of course, the problem gets found/fixed, the program is put back to normal, and it's faster. – Mike Dunlavey Oct 05 '11 at 14:39

1 Answers1

2

Cygwin has gprof. I don't know whether it's installed by default, but you can install it via the Cygwin setup.exe; it's part of the binutils package.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631
  • Yeah, I've heard horror stories about getting it to actually work (see above regarding needing to replace libc or similar). I'll give it a swing, though, thanks. – shaver Oct 27 '11 at 22:48