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

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.  

主站蜘蛛池模板: 郴州市| 潼关县| 黎城县| 习水县| 汽车| 石柱| 九龙坡区| 托里县| 股票| 河间市| 凤阳县| 汾西县| 抚宁县| 榆林市| 保康县| 通化县| 雅江县| 扬州市| 襄汾县| 潮州市| 顺平县| 德兴市| 吴忠市| 普陀区| 五台县| 尉氏县| 新乐市| 蕉岭县| 漾濞| 襄城县| 玉门市| 武义县| 稷山县| 平陆县| 铁岭市| 怀远县| 通化市| 左权县| 柏乡县| 嘉鱼县| 南康市|