From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- libstdc++-v3/doc/html/manual/profile_mode.html | 146 +++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 libstdc++-v3/doc/html/manual/profile_mode.html (limited to 'libstdc++-v3/doc/html/manual/profile_mode.html') diff --git a/libstdc++-v3/doc/html/manual/profile_mode.html b/libstdc++-v3/doc/html/manual/profile_mode.html new file mode 100644 index 000000000..3c1b2d3b5 --- /dev/null +++ b/libstdc++-v3/doc/html/manual/profile_mode.html @@ -0,0 +1,146 @@ + + +Chapter 19. Profile Mode

+ Goal: Give performance improvement advice based on + recognition of suboptimal usage patterns of the standard library. +

+ Method: Wrap the standard library code. Insert + calls to an instrumentation library to record the internal state of + various components at interesting entry/exit points to/from the standard + library. Process trace, recognize suboptimal patterns, give advice. + For details, see + paper presented at + CGO 2009. +

+ Strengths: +

  • + Unintrusive solution. The application code does not require any + modification. +

  • The advice is call context sensitive, thus capable of + identifying precisely interesting dynamic performance behavior. +

  • + The overhead model is pay-per-view. When you turn off a diagnostic class + at compile time, its overhead disappears. +

+

+ Drawbacks: +

  • + You must recompile the application code with custom options. +

  • You must run the application on representative input. + The advice is input dependent. +

  • + The execution time will increase, in some cases by factors. +

+

+ This is the anticipated common workflow for program foo.cc: +

+$ cat foo.cc
+#include <vector>
+int main() {
+  vector<int> v;
+  for (int k = 0; k < 1024; ++k) v.insert(v.begin(), k);
+}
+
+$ g++ -D_GLIBCXX_PROFILE foo.cc
+$ ./a.out
+$ cat libstdcxx-profile.txt
+vector-to-list: improvement = 5: call stack = 0x804842c ...
+    : advice = change std::vector to std::list
+vector-size: improvement = 3: call stack = 0x804842c ...
+    : advice = change initial container size from 0 to 1024
+

+

+ Anatomy of a warning: +

+

Three files are generated. libstdcxx-profile.txt + contains human readable advice. libstdcxx-profile.raw + contains implementation specific data about each diagnostic. + Their format is not documented. They are sufficient to generate + all the advice given in libstdcxx-profile.txt. The advantage + of keeping this raw format is that traces from multiple executions can + be aggregated simply by concatenating the raw traces. We intend to + offer an external utility program that can issue advice from a trace. + libstdcxx-profile.conf.out lists the actual diagnostic + parameters used. To alter parameters, edit this file and rename it to + libstdcxx-profile.conf. +

Advice is given regardless whether the transformation is valid. + For instance, we advise changing a map to an unordered_map even if the + application semantics require that data be ordered. + We believe such warnings can help users understand the performance + behavior of their application better, which can lead to changes + at a higher abstraction level. +

Compile time switches and environment variables (see also file + profiler.h). Unless specified otherwise, they can be set at compile time + using -D_<name> or by setting variable <name> + in the environment where the program is run, before starting execution. +

+

-- cgit v1.2.3