free hit counter
HOLY BIBLE
ace, af_2, al, albanian, am, ar, asv, basic_english, ben, bg, big5, big5_cath, bulgarian, ceb, cebuano, chinese_big5, chinese_gb, cr, cz, darby, de, dk, douay, drc, dutch, fa, fi, fj, fr, french, gaelic_manx, gaelic_scots, gb, gb_cat, german, gk, gk_2, guj, haitian_creole, he, hebrew, hu, hungarian, id_tb, in, in_tr, is, it, jp, kj, kjv20, kjvapocrypha, kjvlarge, kk, kn, korean, kr, latvian_nt, lug, maori, mar, ml, mn, moderngreek, my, ne, nl, no, or, pa, pl, pn, po, po-BR, ro, ru, rumanian, russian_1251, russian_ko18r, se, si, so, sp, spanish, sr, sw, swahili_nt, swedish, tagalog, thaibible, tl, tr, uk, ukrainian, uma_nt, ur, vg, vietnamese, vietnamesevni, vt, vulgate, web, webster, weymouth, xho_2, youngs, zu_2,

PROJECT GUTENBERG
Afrikaans, Aleut, Arapaho, Breton, Bulgarian, Cal, Catalan, Cebuano, Chinese, Czech, Danish, Dutch, Esperanto, Finnish, French, Frisian, Friulian, Gaelic, Scottish, Galician, Gamilaraay, German, Giangan, Greek, Hebrew, Hungarian, Icelandic, Iloko, Interlingua, Inuktitut, Irish, Iroquoian, Italian, Japanese, Kashubian, Khasi, Korean, Latin, Lithuanian, Maori, Mayan Languages, Middle English, Nahuatl, Napoletano-Calabrese, North American Indian, Norwegian, Occitan, Old English, Polish, Portuguese, Romanian, Russian, Sanskrit, Serbian, Spanish, Swedish, Tagalog, Welsh, Yiddish


WIKIPEDIA FOR SCHOOLS: English - Spanish - French - Portuguese

Performance analysis - Wikipedia, the free encyclopedia Wikipedia (2007) - wikipedia2007.classicistranieri.com

Performance analysis

From Wikipedia, the free encyclopedia

In software engineering, performance analysis (a field of dynamic program analysis) is the investigation of a program's behavior using information gathered as the program runs, as opposed to static code analysis. The usual goal of performance analysis is to determine which parts of a program to optimize for speed or memory usage.

Contents

[edit] Use of profilers

A profiler is a performance analysis tool that measures the behavior of a program as it runs, particularly the frequency and duration of function calls. The output is a stream of recorded events (a trace) or a statistical summary of the events observed (a profile). Profilers use a wide variety of techniques to collect data, including hardware interrupts, code instrumentation, operating system hooks, and performance counters. The usage of profilers is called out in the performance engineering process.

As the summation in a profile often is done related to the source code positions where the events happen, the size of measurement data is linear to the code size of the program. In contrast, the size of a trace is linear to the program's runtime, making it somewhat impractical. For sequential programs, a profile is usually enough, but performance problems in parallel programs (waiting for messages or synchronization issues) often depend on the time relationship of events, thus requiring the full trace to get an understanding of the problem.

Program analysis tools are extremely important for understanding program behavior. Computer architects need such tools to evaluate how well programs will perform on new architectures. Software writers need tools to analyze their programs and identify critical pieces of code. Compiler writers often use such tools to find out how well their instruction scheduling or branch prediction algorithm is performing... (ATOM, PLDI, '94)

[edit] History

Profiler-driven program analysis on Unix dates back to at least 1979, when Unix systems included a basic tool "prof" that listed each function and how much of program execution time it used. In 1982, gprof extended the concept to a complete call graph analysis (Gprof: a Call Graph Execution Profiler [1])

In 1994, Amitabh Srivastava and Alan Eustace of Digital Equipment Corporation published a paper describing ATOM [2]. ATOM is a platform for converting a program into its own profiler. That is, at compile time, it inserts code into the program to be analyzed. That inserted code outputs analysis data. This technique, modifying a program to analyze itself, is known as "instrumentation".

In 2004, both the Gprof and ATOM papers appeared on the list of the 20 most influential PLDI papers of all time. [3]

[edit] Profiler Types based on Output

[edit] Flat profiler

Flat profiler's compute the average call times, from the calls, and do not breakdown the call times based on the callee or the context.

[edit] Call-Graph profiler

Call Graph profilers show the call times, and frequencies of the functions, and also the call-chains involved based on the callee. However context is not preserved.

[edit] Methods of data gathering

[edit] Event based profilers

In Programming languages listed, all of them have event-based profilers

  1. Java: JVM-Profiler Interface JVM API provides hooks to profiler, for trapping events like calls, class-load, unload, thread enter leave.
  2. Python: Python profilers are profile module, hotspot which are call-graph based, and use the 'sys.set_profile()' module to trap events like c_{call,return,exception}, python_{call,return,exception}.
  3. Ruby: Ruby also uses a similar interface like Python for profiling. Flat-profiler in profile.rb, module, and ruby-prof a C-extension are present.

[edit] Statistical profilers

Some profilers operate by sampling. A sampling profiler probes the target program's program counter at regular intervals using operating system interrupts. Sampling profiles are typically less accurate and specific, but allow the target program to run at near full speed.

Some profilers instrument the target program with additional instructions to collect the required information. Instrumenting the program can cause changes in the performance of the program, causing inaccurate results and heisenbugs. Instrumenting can potentially be very specific but slows down the target program as more specific information is collected.

The resulting data are not exact, but a statistical approximation. The actual amount of error is usually more than one sampling period. In fact, if a value is n times the sampling period, the expected error in it is the square-root of n sampling periods. [4]

Some of the most commonly used statistical profilers are GNU's gprof, Oprofile and SGI's Pixie.

[edit] Instrumentation

  • Manual: Done by the programmer, e.g. by adding instructions to explicitly calculate runtimes.
  • Compiler assisted: Example: "gcc -pg ..." for gprof, "quantify g++ ..." for Quantify
  • Binary translation: The tool adds instrumentation to a compiled binary. Example: ATOM
  • Runtime instrumentation: Directly before execution the code is instrumented. The program run is fully supervised and controlled by the tool. Examples: PIN, Valgrind
  • Runtime injection: More lightweight than runtime instrumentation. Code is modified at runtime to have jumps to helper functions. Example: DynInst
  • Hypervisor: Data are collected by running the (usually) unmodified program under a hypervisor. Example: SIMMON
  • Simulator: Data are collected by running under an Instruction Set Simulator. Example: SIMMON

[edit] Simple manual technique

As an alternative to profiling tools, there is a manual technique of performance analysis for single-thread software, called "random halting" or "deep sampling". It requires being able to run the software under a suitable debugger, and being able to halt it at a truly random time, such as via a "pause" key. First the program is modified, if necessary, to make it take more than a few seconds, perhaps by adding an outer loop. Then, while it is running, it is halted with the "pause" key. The state of the program is examined in detail, looking not only at where the program counter is, but at all levels of the call stack, and the data structure if necessary. A complete understanding of what it is doing at that time, and especially why, is determined. This process is repeated several times. 10 or 20 should be more than enough. This gives a very good picture of what the program is doing, from a time perspective.

Generally the program can be speeded up, because just as software contains bugs, it can also contain "slugs" (i.e. slowness bugs). These do not make the software incorrect; they only make it slower than necessary, often much slower. Bugs are usually removed during program testing, while slugs are usually not.

There are many different kinds of slugs. Some are "hot spots". Others are extraneous function calls (more common in large software). Some are caused by aspects of the data structure that cannot be discerned by looking at the call stack alone. Generally the more layers of abstraction employed in a software project, the greater the opportunities for speedup because the call stack is generally deeper, with each level representing calls that could be unnecessary. Sometimes a powerful function or subroutine is written with the assumption that it will be treated with a certain reverance and used sparingly, while the user of the function invokes it multiple times because it accomplishes so much for the seemingly trivial cost of a function call. There is a tendency to believe, if function A calls function B, that that call is necessary, because why else would the programmer have coded it? I.e. the code is presumed to be well-justified. Rather, it should be assumed to contain poorly justified time-consuming behaviors, which are the slugs. That is why the why of each sample must be assessed.

The object with slugs is to discover them (not to measure them with precision). If a slug X is taking x% of the execution time, it is displayed on any given sample with probability x%, whether it consists of one large block of time, or many small ones. x% is typically in the range from 5% to 95%, and the larger it is, the fewer samples are needed to see it.

Experience has shown that this process can be iterated several times, getting large speedups. For example, slug X1 could be taking 50% of the time, and X2 could be taking 25% of the time. If X1 is removed, execution time is cut in half, at which point X2 takes 50% of the time. If on the first pass X2 is removed instead, the time is only reduced by 1/4, but then X1 is seen as taking 67% of the time, so it is even more obvious, and can be removed. Either way, removing both X1 and X2 reduces execution time by 75%, so the remaining slugs are four times larger. This "magnification effect" allows the process to continue through X3, X4, and so on until a point of diminishing returns is reached.

[edit] See also

[edit] List of Profilers

[edit] C and C++

  • gprof The GNU Profiler, part of GNU Binutils (which are part of the GNU project); you can use some visualization tools called VCG tools and combine both of them using Call Graph Drawing Interface (CGDI); a second solution is kprof. More for C/C++ but works well for other languages.
  • Valgrind is a GPL'd system for debugging and profiling x86-Linux programs. You can automatically detect many memory management and threading bugs. alleyoop is a front-end for valgrind. It works for any language and the assembler.
  • VTune(tm) Performance Analyzer is Intel's family of commercial performance analyzers for Windows and Linux executables on Intel CPUs. It has command-line tools, a standalone environment and plugins for Microsoft Visual Studio and Eclipse.
  • PurifyPlus is a commercial family of performance analysis tools from IBM's Rational unit. For Linux, UNIX and Windows.
  • Visual Studio Team System Profiler is Microsoft's commercial profiler offering
  • Shark is Apple's free performance analyzer for Macintosh executables.
  • Intel Software Tools, Intel Analyzers, Compilers, Libraries
  • PerfSuite is an open source collection of tools and libraries for application performance analysis on Linux that includes aggregate performance measurement and statistical profiling using hardware performance counters. A tutorial/introduction is available here.
  • OProfile statistical, kernel based GPL profiler for Linux
  • Tutorial on the use of Oprofile
  • CodeAnalyst is AMD's free performance analyzer for Windows programs on AMD hardware. AMD also has a Linux version of CodeAnalyst.
  • Profiler for use with Digital Mars C, C++ and D compilers.
  • Sysprof is a statistical profiler for Linux that uses a kernel module to profile all running processes. Its user interface shows the processes' call trees graphically.
  • PAPI is a portable interface (in the form of a library) to hardware performance counters on modern microprocessors.
  • DynaProf is a performance analysis tool designed to insert performance measurement instrumentation directly into a running applications' address space at run time. It can measure real-time as well as any hardware performance metrics available through the PAPI.
  • TAU is an integrated performance instrumentation, measurement and analysis toolkit that uses PAPI. Automatic source-to-source instrumentation is implemented in TAU using the PDT Program Database Toolkit package. TAU provides both profiling and tracing capabilities. TAU uses the OTF (Open Trace Format) for scalable tracing for use with the Vampir/Vampir Server trace visualizers.
  • AQTime is a commercial Windows profiler for Microsoft, Borland, Intel, Compaq and GNU compilers.
  • DynInst Homepage
  • GlowCode

[edit] Java

[edit] .NET

[edit] Visual Basic

[edit] Various languages

  • DevPartner is Compuware's test suite for both .NET and Java that automatically detects and diagnoses software defects and performance problems.
  • Performance Analyzer included with Sun Studio (free)
  • OpenView-TA is a commercial profiler from HP for Microsoft & Java that includes method level latency measurement and reporting for application bottleneck analysis

[edit] Network Performance

[edit] External links

STATIC WIKIPEDIA JUNE 2008 on wikipedia2006.classicistranieri.com

aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu

STATIC WIKIPEDIA MARCH 2008 on wikipedia2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA APRIL 2007 on wikipedia2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA DECEMBER 2006 on wikipedia2006classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.

STATIC WIKIPEDIA NOVEMBER 2006 on wikipedia 2007classicistranieri.com
aa, ab, af, ak, als, am, an, ang, ar, arc, as, ast, av, ay, az, ba, bar, bat_smg, be, bg, bh, bi, bm, bn, bo, bpy, br, bs, bug, bxr, ca, cbk_zam, cdo, ce, ceb, ch, cho, chr, chy, closed_zh_tw, co, cr, cs, csb, cu, cv, cy, da, de, diq, dv, dz, ee, el, eml, en, eo, es, et, eu, fa, ff, fi, fiu_vro, fj, fo, fr, frp, fur, fy, ga, gd, gl, glk, gn, got, gu, gv, ha, haw, he, hi, ho, hr, hsb, ht, hu, hy, hz, ia, id, ie, ig, ii, ik, ilo, io, is, it, iu, ja, jbo, jv, ka, kg, ki, kj, kk, kl, km, kn, ko, kr, ks, ksh, ku, kv, kw, ky, la, lad, lb, lbe, lg, li, lij, lmo, ln, lo, lt, lv, map_bms, mg, mh, mi, mk, ml, mn, mo, mr, ms, mt, mus, my, mzn, na, nah, nap, nds, nds_nl, ne, new, ng, nl, nn, no, nov, nrm, nv, ny, oc, om, or, os, pa, pag, pam, pap, pdc, pi, pih, pl, pms, ps, pt, qu, rm, rmy, rn, ro, roa_rup, roa_tara, ru, ru_sib, rw, sa, sc, scn, sco, sd, se, searchcom, sg, sh, si, simple, sk, sl, sm, sn, so, sq, sr, ss, st, su, sv, sw, ta, te, test, tet, tg, th, ti, tk, tl, tlh, tn, to, tokipona, tpi, tr, ts, tt, tum, tw, ty, udm, ug, uk, ur, uz, ve, vec, vi, vls, vo, wa, war, wo, wuu, xal, xh, yi, yo, za, zea, zh, zh_classical, zh_min_nan, zh_yue, zu.