• About

Dudefrommangalore's Weblog

~ Computer Programming, Software Management and Random Thoughts…

Dudefrommangalore's Weblog

Category Archives: google

Profiling C++ code using Google Performance Tools

09 Thursday Feb 2012

Posted by dudefrommangalore in c++, google, performance, programming, tips

≈ 4 Comments

Google performance tool is an excellent tool for profiling C++ code.

  • Install libunwind
  • Install Google Performance Tools
  • Install supporting packages
  • Include profiling code in C++
  • Run Profiling
  • Generate profiling report

Install libuwind

wget http://download.savannah.gnu.org/releases/libunwind/libunwind-1.0.1.tar.gz
tar xvfz libunwind-1.0.1.tar.gz
cd libunwind-1.0.1
export CFLAGS=-U_FORTIFY_SOURCE
./configure
make
sudo make install

Install Google Performance Tools

wget http://google-perftools.googlecode.com/files/google-perftools-1.8.3.tar.gz
tar xvfz google-perftools-1.8.3.tar.gz
cd google-perftools-1.8.3
./configure
make
sudo make install

Install supporting packages

sudo apt-get install graphviz
sudo apt-get install gv

Include profiling code in C++

Include supporting header file(s)

#include <google/profiler.h>

Start Profiler

Assuming that profiler output is stored in file /tmp/output.pprof. The following code can be placed anywhere in the code. This is the point at which the profiler will start collecting data. It is possible to start profiling at multiple stages into different files.

ProfilerStart("/tmp/output.pprof);

Stop Profiler

It is possible to start profiler at any point of time by placing the following code.

ProfilerStop();

Run Profiling

Compile the code and execute it. Once the run is finished or ProfilerStop is called, profiler output will be available in the output file.

Generate profiling report

Several types of reports can be generated from the output file.

Graphical report

X11 need to be enabled for the graphical report.

pprof -gv --lines /tmp/output.pprof
Advertisements

Invention – Overloaded…

07 Monday Nov 2011

Posted by dudefrommangalore in articles, google, highavailability

≈ Leave a comment

In the recent times, word “Invention” seems to be overloaded. In the recent article on Forbes magazine Can MapReduce be Made Easy?, author claims that MapReduce was Invented by Google.

This is not clearly the case. MapReduce was popularized by Google. People who write articles need to do more fact findings before publishing their articles. At least editors of the magazine need to more diligent work.

Good article on DBMS2 clear this confusion.

MapReduce was named and popularized — but not invented — by Google.

“MapReduce” refers to:

  • A programming paradigm
  • Execution engines that implement the programming paradigm
  • Distributed file systems that work with the execution engines

Who is more open? Google or Yahoo or Bing?

30 Saturday Jan 2010

Posted by dudefrommangalore in atom, auto-discovery, bing, feed, google, microsoft, open standards, rss, search, yahoo

≈ Leave a comment

While looking at the search result page HTML from Google, Yahoo and Bing, I discovered that Google does not add auto discovery to its search result page. Where as Yahoo and Bing does.

That makes me wonder why Yahoo and Bing does not get as much credit as Google for adopting the open technologies/standards?

My Tweets
Advertisements

Blog at WordPress.com.