Java profiling - how can I get a method by method analysis of my application?

后端 未结 7 1272
挽巷
挽巷 2020-12-29 03:01

I want to run my Java app and for a given workload be able to see:

  • how many times a given function was called
  • how expensive each function call is in
7条回答
  •  心在旅途
    2020-12-29 03:45

    There have been a couple profilers listed (The eclipse one and JProfiler). I just want to HIGHLY RECOMMEND that a profiler is one of the tools in your programming toolchest.

    This is something most programmers pass over, but a profiler can solve entire classes of problems that are very difficult to solve otherwise.

    I'm just saying (to everyone, not just the questioner) that if you haven't used a profiler go find one, download it and run it.

    By the way, they are much more powerful than the static output of the java tools--although the java tools might be enough in this specific case. A profiler can tell you what each thread is doing and can make some pretty cool call graphics (flow diagram style) that will help you analyze code you didn't write.

    Just find one, and use it for a week or two so that you know what it offers.

提交回复
热议问题