Profiling disk access

后端 未结 3 1569
耶瑟儿~
耶瑟儿~ 2021-01-13 02:14

Currently I am working on a MFC application which reads and writes in to the disk. Sometimes this application runs amazingly fast and sometimes it is damn slow. I am guessin

3条回答
  •  借酒劲吻你
    2021-01-13 03:04

    What I would do is, if you can't pause all threads at the same time and examine their state, focus on one of them and pause that, while it's being "damn slow". This is a little known but effective technique.

    Since it is being extremely slow compared to what it could be, whatever it is waiting for it is waiting for probably 99% of the time, so when you pause it you will see it. That's true whether it's one big wait, or a zillion little ones. Look at the whole call stack. The culprit may be somewhere in the middle of the stack.

    If you're not sure, pause it two or three times. The culprit will be on all stack samples.

提交回复
热议问题