官术网_书友最值得收藏!

Sampling Profiler

The Sampling Profiler is, as its name suggests, a sampling profiler for Delphi, written by Eric Grange. You can find it at www.delphitools.info. Although it officially supports only Delphi 5 to XE4, it will function well with applications written in modern Delphis.

The strongest part of the Sampling Profiler is its configurability for multithreaded sampling. You can specify which CPUs will execute the profiler and which profiled application. You can also focus on a specific thread by issuing a OutputDebugString('SAMPLING THREAD threadID') command from your code (replace threadID with the real ID of the thread you want to profile). It is also very simple to turn profiling on or off by calling OutputDebugString('SAMPLING ON') and OutputDebugString('SAMPLING OFF').

An interesting feature of the Sampling Profiler, which other profilers don't provide, is the ability to enable web server in the profiler. After that, we can use a browser to connect to the profiler (if firewalls allow us, of course) and we get an instant insight into the currently most executed lines of our program:

Live status view from remote location

The weakest point of the Sampling Profiler is its complete inability to select methods that are of interest to us. As we can see in the following screenshot, we get some methods from Generics.Collections mixed between methods from SlowCode. This only distracts us from our task—trying to find the slow parts of SlowCode.

Saying all that, I must admit that the display of profiling results is really neatly implemented. The results view is simple, clean, and easy to use:

Simple and effective result view

The Sampling Profiler would be a perfect solution for occasional profiling if it would only allow us to select topics of interest.  

主站蜘蛛池模板: 和田县| 江门市| 通辽市| 连南| 化德县| 怀安县| 长乐市| 冷水江市| 石景山区| 南木林县| 洛宁县| 新化县| 大关县| 绥芬河市| 宽甸| 尼木县| 昌宁县| 象山县| 新邵县| 连云港市| 屏山县| 靖州| 江山市| 竹溪县| 平原县| 郸城县| 扶沟县| 电白县| 阿坝县| 寿宁县| 凉城县| 博湖县| 聊城市| 伊金霍洛旗| 开平市| 剑阁县| 金昌市| 广南县| 锦州市| 温宿县| 凤山市|