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

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.  

主站蜘蛛池模板: 措勤县| 姚安县| 巴南区| 吉水县| 都匀市| 洱源县| 日喀则市| 襄汾县| 长春市| 邢台市| 右玉县| 青川县| 达州市| 霍州市| 台湾省| 酒泉市| 长阳| 江安县| 海林市| 天祝| 梓潼县| 东丰县| 特克斯县| 三台县| 克东县| 河西区| 宝山区| 海南省| 乐陵市| 吉木萨尔县| 德令哈市| 荔浦县| 新平| 海安县| 会昌县| 松潘县| 镇原县| 金塔县| 康平县| 额济纳旗| 萝北县|