Four Google open source tools on Google Code
Posted by
Dion Almaer, Google Developer ProgramsOver the past two
years, Google has released several infrastructure tools as open source software.
Today we're pleased to host them on
Google Code project hosting.
These tools have made life easier for us in many ways over the years and are
found in many (for some of these, all) Google projects.
gflags:
Commandline flags module for C++.
At Google we needed a replacement for
getopt()
that was
both simpler to use and more powerful. The result, gflags, has stood the test of time, being
usable for both large projects with many internal libraries, each of which like to have
command-line flags; and straightforward enough to be the preferred solution on small projects
as well.
This package has implementations in both C++ and Python,
allowing you to use a similar API in the different worlds.
Another nice
feature is that you can run a program,
gflags2man
, that creates a man
page for any executable written using gflags.
For more information,
please
read the
documentation.
perftools:
Fast, mutli-threaded malloc() and nifty performance analysis tools.
The perftools package is a collection of a
high-performance multi-threaded malloc() implementation, plus some pretty nifty performance
analysis tools. TC Malloc has been out in the wild for quite some time, with many other
projects using it to get that little bit extra performance.
Along with
TC Malloc, perftools also contains a Heap Checker, Heap Profiler, and a CPU Profiler.
Take a peek at
an overview of
the Google Performance Tools.
sparsehash:
An extremely memory-efficient hash_map implementation.
At Google, we really care about performance. The
SparseHash
package contains several hash-map implementations,
including one implementation that optimizes for space, and another that optimizes for speed.
If you are excited about an extremely memory-efficient hash_map implementation -- with only 2
bits/entry overhead! -- replace that
hash_map
in your code with a
sparse_hash_map
. Alternately, try a
dense_hash_map
for a hashtable implementation that uses more memory
in exchange for very fast performance.
Learn how to use
the hash_map implementations.
ctemplate:
A simple but powerful template language for C++.