glog with tcmalloc

shinh さんの glog なんかをいじる。
MacBook Core 2 Duo 2.0GHz にて。

#include <glog/logging.h>

static const int REPEAT = 100000;

int main(int argc, char** argv)
{
    google::InitGoogleLogging(argv[0]);

    for (int i = 0; i < REPEAT; i++) {
        LOG(INFO) << "log message for google logging library.";
    }

    return 0;
}
% g++ -c -O2 -g test_glog.cc
% g++ test_glog.o -lpthread -lglog -o test_glog
% time ./test_glog
./test_glog  1.22s user 1.18s system 93% cpu 2.583 total

% g++ test_glog.o -lpthread -lglog -ltcmalloc -o test_glog_with_tcmalloc
% time ./test_glog_with_tcmalloc
./test_glog_with_tcmalloc  0.49s user 0.06s system 80% cpu 0.684 total

tcmalloc すげえな。