タグ

valgrindとperformanceに関するdannのブックマーク (3)

  • C(++)言語: valgrindの使い方 (cachegrind)

    ubuntu% gcc cache.c; time ./a.out ./a.out 0.41s user 0.03s system 99% cpu 0.444 total ubuntu% gcc -DBAD cache.c; time ./a.out ./a.out 1.98s user 0.03s system 99% cpu 2.020 total ubuntu% gcc cache.c; valgrind --tool=cachegrind ./a.out ==11733== Cachegrind, an I1/D1/L2 cache profiler. ==11733== Copyright (C) 2002-2005, and GNU GPL'd, by Nicholas Nethercote et al. ==11733== Using LibVEX rev 1367, a

  • KCachegrindを使ったコード改善 (実践編) « Stop Making Sense

    図の掲載は省略しますが、string::reserve() の Call Graph でも改善されていることが確認出来ます。 開発者が直接new/deleteを記述していなくても、プロファイルを取ってみるとヒープの取得・解放が頻発してて、しかもstringクラス絡みが結構な割合…ということが時々有ります。(例えば、詳細なログを多く出しているような真面目なプログラムにその傾向が…) 頻繁にヒープの取得・解放を繰り返すようなシステムは、例え受入れ試験を通過したとしても、その後、長期安定稼働してくれるか不安になります。何かの拍子にシステム全体が不安定になったとき、自分たちの担当したプロセスはちゃんと動いてくれるだろうか…などと考えると、夜も眠れません心配になってきます。 STL(特にコンテナやstringクラス)を使っている場合、ヒープの取得を完全に無くすことは難しい(限りなく無理)ですが、回数

  • Valgrind

    To use this tool, you must specify --tool=callgrind on the Valgrind command line. Callgrind is a profiling tool that records the call history among functions in a program's run as a call-graph. By default, the collected data consists of the number of instructions executed, their relationship to source lines, the caller/callee relationship between functions, and the numbers of such calls. Optionall

  • 1