What are some resources I can use to learn profiling/optimizing?

后端 未结 11 1899
醉梦人生
醉梦人生 2020-12-24 10:03

I just inherited a C# project that runs way to slow and will have to start optimizing it. What I wanted to do first is learn a little more about profiling/optimizing since I

11条回答
  •  独厮守ぢ
    2020-12-24 10:21

    I would download a few of the profiling tools available (free trials) and start using them.

    I used jetbrains , and there are others. (ants for example, devpartner and a MS one?, atomatedqa, etc) You should not have too much problems running them. They have reports that give you lots of information and you can learn pretty quickly just using the applications.

    Any one of them will probably help you and it is nice to use the trials. You can then either just shelve the decision to buy the tool, or buy the one(s) that was the most helpful/easiest to use. In general they are great time savers and worth the money, though some can be expensive. (I have a hard time with the ones on the upper end when there are very good tools for a lot less money)

    You might find some serious/major performance issues the first day you install and run them. I know I did.

    good luck.

    just download some tools and start running your app.

    EDIT:

    As for books and learning - basically the best way to learn about problems with code is to find bad code. Many times doing inspections with experienced developers will be helpful.

    as an example: I think Joel wrote an article way back about he did something like

    for (int i = 0; i < strlen(some string); i++)

    that is pretty obvious that you are going to call strlen (expensive) every iteration of the loop.

    You'll have to look at some of the code after the profiler tells you where time is being spent and see if the code can be fixed easily with simple things like that, or changes have to be made in the design of the algorithms.

提交回复
热议问题