Performance:Tools: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(mark that this page is very outdated)
 
(18 intermediate revisions by 6 users not shown)
Line 1: Line 1:
= Memory Leaks =
{{delete|This information is very outdated, please see https://firefox-source-docs.mozilla.org/performance/index.html for more current information about performance tools in Mozilla.|date=10/17/2023}}


Tools for tracking down memory leaks. See also [[Performance:Leak_Tools]] which contains more details for each tool.
== Profiling tools ==


* [http://www.mozilla.org/projects/xpcom/MemoryTools.html XPCOM Memory Leak tools] (this document also has information on Mozilla's other memory leak tools). See also a [http://www.mozilla.org/performance/leak-tutorial.html tutorial] on using these tools and the refcount balancer.
The following tools are used to measure product performance.
* [http://www.ibm.com/software/awdtools/purify/ Rational Purify®]. (Commercial)
 
* [http://www.glowcode.com/summary.htm GlowCode]. (Commercial)
=== Platform-independent ===
* [http://perens.com/FreeSoftware/ElectricFence/ ElectricFence].
 
** "Electric Fence ... uses the virtual memory hardware of your system to detect when software overruns the boundaries of a malloc() buffer. It will also detect any accesses of memory that has been released by free(). Because it uses the VM hardware for detection, Electric Fence stops your program on the first instruction that causes a bounds violation."
* [[Platform/FunctionTimer Usage|FunctionTimer]] - Timing instrumentation. Useful for app startup measurements.
Specifically, it works by placing each heap allocation on its own VM page. Since the dynamic footprint of the browser is pretty large, this may make it tough to use "in real life".
* [http://www.mozilla.org/performance/jsprofiler.html JS Runtime Profiler]. Profile JavaScript usage, dumps output to a file.
* [http://lxr.mozilla.org/mozilla/source/tools/leaky/leaky.html Leaky]. This is a home-grown tool that [mailto:kipp@netscape.com Kipp] put together:
* [http://blog.mozilla.com/dmandelin/2009/02/26/tracevis-performance-visualization-for-tracemonkey/ TraceVis] and [http://code.google.com/p/ethogram/ Ethograms] - [https://developer.mozilla.org/en/TraceVis TraceVis usage] and ethogram bug {{bug|497999}}
** "Its a tool called leaky. What it does it help you track down memory leaks and some kinds of memory corruption. It also has entry pointers for logging addref/release calls. The key thing that leaky does is this: it logs all calls to malloc/free/realloc/new/delete into a log file. The logging data includes information about size and address, as well as the *call stack of the operation*. The leaky program then can translate the call stack data from addresses into symbols and then dump the data out." *
* [[Perfomatic|Mozilla graph server]]
* [http://www.mozilla.org/performance/refcnt-balancer.html refcount balancer]. This is another home-grown tool that does finer-grained instrumentation and allows you to focus on specific objects rather than entire runs.
* [[TestEngineering/Performance/Talos|Talos]] - really nice setup where various performance tests are run automatically and compared against previous builds. Results are posted to the [news://news.mozilla.org/mozilla.dev.tree-management mozilla.dev.tree-management] newsgroup
* [http://www.parasoft.com/products/insure/index.htm Insure++®]. (Commercial) Evaluation copy is free. [http://www.parasoft.com/press/releases/insure/ins_lite_ver.htm Linux version].
* [[Dromaeo]] - in-browser Javascript tests
* [http://www.andreasen.org/LeakTracer/ LeakTracer].
* [https://developer.mozilla.org/en/Mochitest mochitests] - test harness for writing tests in js using full browser
* [http://www.inf.ethz.ch/personal/biere/projects/ccmalloc/ ccmalloc].
* Various internal tools/settings/whatever
* [http://quorum.tamu.edu/jon/gnu/ debauch] Dead?
** {{bug|568863}} - provide access to hw perf counters
* [http://www.linkdata.se/sourcecode.html memwatch].
** {{bug|507012}} - Javascript callback for function entry/exit
* [http://www.geodesic.com/products/greatcircle.html Geodesic Systems' GreatCircle] Dead? [mailto:fur@netscape.com Scott Furman] has done some preliminary work to get this product working with Mozilla.
 
* [mailto:jseward@acm.org Julian Seward] writes of [http://valgrind.org/ Valgrind], an open-source memory debugger and profiler for Linux/x86: `Snapshots 20020511 and later of the tool are able to run Mozilla correctly on both Red Hat 6.2 and 7.2. It will also do detailed low-level I1/D1/L2 cache profiling, so you can see which bits of Mozilla create cache misses. You'll need the patch from [http://bugzilla.mozilla.org/show_bug.cgi?id=124335 bug 124335] if working with versions prior to 1.0RC2.
=== Platform-specific ===
 
==== Windows ====
 
* [https://developer.mozilla.org/Profiling_with_AMD_CodeAnalyst AMD CodeAnalyst]
* Xperf
** ETW (Event Tracing for Windows)
* [http://www.sysinternals.com/ Sysinternals utilities]. Win9x/Me/NT/2K utilites for monitoring system usage. CPU/Mon, Diskmon, Filemon, Regmon, etc.
 
==== Mac ====
 
* [https://developer.mozilla.org/en/Profiling_JavaScript_with_Shark Shark]
* The Metrowerks Profiler (on subsets of the codebase), or Apple's Instrumentation SDK. For details, see the [http://www.mozilla.org/performance/mac-performance.html Mac performance page].


= Profiling =
==== Linux ====


The following tools are used to measure product performance.
* [https://wiki.mozilla.org/Performance:Tools/oprofile oprofile]
* sysprof
* [http://www.mozilla.org/performance/jprof.html jprof]. Sampling profiling tool by [mailto:jim_nance@yahoo.com Jim Nance] that runs on 32-bit Linux.
* [http://www.mozilla.org/performance/eazel.html eazel profilers]. Two profiling tools from Eazel/gnome.org.
* [https://perf.wiki.kernel.org/index.php/Main_Page perf] - originally just for the kernel itself, now has decent user-space capabilities
* [http://sourceware.org/systemtap/wiki SystemTap] - similar to perf, but different. They share quite a bit of infrastructure.
 
More about perf and SystemTap:
 
SystemTap has a scripting language that gets converted to kernel modules, so is extremely customizable. It is not in the kernel tree, so may not work on the latest greatest kernel. Perf is the current Chosen One within the kernel developer community, and is in the tree (''lots'' of development is happening on perf right now; someone commented that it seems like soon the kernel will be a thin wrapper kept around only to enable running perf.)
 
Both are useful at seeing what the kernel is doing as a result of a user-space process or processes. Both have some ability to look directly at user processes and report only on them. SystemTap is attempting to be compatible with Solaris's excellent dtrace toolkit, but is still pretty rough. (eg I can't get it to link successfully right now. Taras ran into many different issues.) Both support dynamic probes as well as statically inserted probes. Static probes in user space have rough edges.
 
==== Other ====
 
* dtrace - excellent dynamic tracing framework for Solaris. SystemTap is attempting to port and extend its capabilities to Linux.
* [http://alisa.ucsd.edu/cgi/webman?SEARCH+man5+hiprof.5.gz hiprof]. A hierarchical instruction profiler for Digital Unix. There is an [http://www.mozilla.org/performance/atom/atom.html online tutorial], courtesy [mailto:jim_nance@yahoo.com Jim Nance] (jim_nance@yahoo.com):
** ''"I like it because it does not require you to recompile the program, because it give accurate times for callers, and because it comes with DU so that everyone developing there should already have it." [news://news.mozilla.org/slrn7jop6f.jlq.jlnance%40Bessie.acs.uncwil.edu *]''
 
==== Multiple ====


* [http://valgrind.org/docs/manual/cl-manual.html callgrind] (part of valgrind)
* VTune (Windows & Linux)
* [http://www.ibm.com/software/awdtools/purifyplus/ Rational PurifyPlus]. (Commercial) Used to be called Rational Quantify.
* [http://www.ibm.com/software/awdtools/purifyplus/ Rational PurifyPlus]. (Commercial) Used to be called Rational Quantify.
** [http://www.mozilla.org/performance/qfy2html.pl qfy2html.pl]. A Perl script for munging Quantify 6.0 output into hyperlinked HTML to share with your friends. Run Quantify, save your results as text, and then let this thing rip.
** [http://www.mozilla.org/performance/qfy2html.pl qfy2html.pl]. A Perl script for munging Quantify 6.0 output into hyperlinked HTML to share with your friends. Run Quantify, save your results as text, and then let this thing rip.
** [http://www.mozilla.org/unix/quantify.html Quantifying Mozilla on Solaris]. Instructions on how to make Quantify play nicely with Mozilla on Solaris.
** [http://www.mozilla.org/unix/quantify.html Quantifying Mozilla on Solaris]. Instructions on how to make Quantify play nicely with Mozilla on Solaris.
* For performance work on Mac, you can use either the Metrowerks Profiler (on subsets of the codebase), or Apple's Instrumentation SDK. For details, see the page on [http://www.mozilla.org/performance/mac-performance.html Mac performance].
* [http://alisa.ucsd.edu/cgi/webman?SEARCH+man5+hiprof.5.gz hiprof]. A hierarchical instruction profiler for Digital Unix. There is an [http://www.mozilla.org/performance/atom/atom.html online tutorial], courtesy [mailto:jim_nance@yahoo.com Jim Nance] (jim_nance@yahoo.com):
** "I like it because it does not require you to recompile the program, because it give accurate times for callers, and because it comes with DU so that everyone developing there should already have it." [news://news.mozilla.org/slrn7jop6f.jlq.jlnance%40Bessie.acs.uncwil.edu *]
* [http://www.mozilla.org/performance/jprof.html jprof]. Sampling profiling tool by [mailto:jim_nance@yahoo.com Jim Nance] that runs on RedHat 6.1, 6.2.
* [http://www.mozilla.org/performance/measureStartup.html MOZ_TIMELINE] Timing instrumentation. Extremely useful for app startup measurements.
* [http://www.mozilla.org/performance/eazel.html eazel profilers]. Two profiling tools from Eazel/gnome.org, runs on Linux.
* [http://www.mozilla.org/performance/jsprofiler.html JS Runtime Profiler]. Profile JavaScript usage, dumps output to a file.
* [http://www.sysinternals.com/ Sysinternals utilities]. Win9x/Me/NT/2K utilites for monitoring system usage. CPU/Mon, Diskmon, Filemon, Regmon, etc.
* [http://www.gnu.org/software/binutils/manual/gprof-2.9.1/gprof.html gprof]. Part of the [http://www.gnu.org/software/binutils/ GNU Binutils]. Back in May 1999 there were rumors that gprof had trouble with dynamically linked and loaded objects (like Mozilla). Currently (March 2006) gprof is still being developed, so hopefully that's no longer true (assuming it ever was). The link to the gprof manual above is *years* out of date but, at the time of writing, it's the latest version of the [http://www.gnu.org/manual/ manual on gnu.org]. To get an up to date version of the manual, get the gprof source and run |. configure; make html| in the gprof source directory.
* [http://www.gnu.org/software/binutils/manual/gprof-2.9.1/gprof.html gprof]. Part of the [http://www.gnu.org/software/binutils/ GNU Binutils]. Back in May 1999 there were rumors that gprof had trouble with dynamically linked and loaded objects (like Mozilla). Currently (March 2006) gprof is still being developed, so hopefully that's no longer true (assuming it ever was). The link to the gprof manual above is *years* out of date but, at the time of writing, it's the latest version of the [http://www.gnu.org/manual/ manual on gnu.org]. To get an up to date version of the manual, get the gprof source and run |. configure; make html| in the gprof source directory.
== Other References ==
* [[Performance:Leak_Tools|Leak Tools]]

Latest revision as of 14:31, 17 October 2023

Do not edit this page THIS PAGE IS PROPOSED FOR DELETION 10/17/2023
This information is very outdated, please see https://firefox-source-docs.mozilla.org/performance/index.html for more current information about performance tools in Mozilla.

Profiling tools

The following tools are used to measure product performance.

Platform-independent

Platform-specific

Windows

Mac

  • Shark
  • The Metrowerks Profiler (on subsets of the codebase), or Apple's Instrumentation SDK. For details, see the Mac performance page.

Linux

  • oprofile
  • sysprof
  • jprof. Sampling profiling tool by Jim Nance that runs on 32-bit Linux.
  • eazel profilers. Two profiling tools from Eazel/gnome.org.
  • perf - originally just for the kernel itself, now has decent user-space capabilities
  • SystemTap - similar to perf, but different. They share quite a bit of infrastructure.

More about perf and SystemTap:

SystemTap has a scripting language that gets converted to kernel modules, so is extremely customizable. It is not in the kernel tree, so may not work on the latest greatest kernel. Perf is the current Chosen One within the kernel developer community, and is in the tree (lots of development is happening on perf right now; someone commented that it seems like soon the kernel will be a thin wrapper kept around only to enable running perf.)

Both are useful at seeing what the kernel is doing as a result of a user-space process or processes. Both have some ability to look directly at user processes and report only on them. SystemTap is attempting to be compatible with Solaris's excellent dtrace toolkit, but is still pretty rough. (eg I can't get it to link successfully right now. Taras ran into many different issues.) Both support dynamic probes as well as statically inserted probes. Static probes in user space have rough edges.

Other

  • dtrace - excellent dynamic tracing framework for Solaris. SystemTap is attempting to port and extend its capabilities to Linux.
  • hiprof. A hierarchical instruction profiler for Digital Unix. There is an online tutorial, courtesy Jim Nance (jim_nance@yahoo.com):
    • "I like it because it does not require you to recompile the program, because it give accurate times for callers, and because it comes with DU so that everyone developing there should already have it." *

Multiple

  • callgrind (part of valgrind)
  • VTune (Windows & Linux)
  • Rational PurifyPlus. (Commercial) Used to be called Rational Quantify.
    • qfy2html.pl. A Perl script for munging Quantify 6.0 output into hyperlinked HTML to share with your friends. Run Quantify, save your results as text, and then let this thing rip.
    • Quantifying Mozilla on Solaris. Instructions on how to make Quantify play nicely with Mozilla on Solaris.
  • gprof. Part of the GNU Binutils. Back in May 1999 there were rumors that gprof had trouble with dynamically linked and loaded objects (like Mozilla). Currently (March 2006) gprof is still being developed, so hopefully that's no longer true (assuming it ever was). The link to the gprof manual above is *years* out of date but, at the time of writing, it's the latest version of the manual on gnu.org. To get an up to date version of the manual, get the gprof source and run |. configure; make html| in the gprof source directory.

Other References