This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Optimizing using grof, interpreting flat profile?
- From: susan_in_california <bajichuan at hotmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Mon, 22 Jun 2009 15:06:04 -0700 (PDT)
- Subject: Optimizing using grof, interpreting flat profile?
Hello, everyone! I think I have just enough C++ knowledge to write very bad
code, and I would really like to just be better.
I am writing an algorithm that has to do with solving integer programs, and
thus I am dealing extensively with integer matrices, in particular column
vectors stored as vector<int>. Here is a line from my gprof:
% cumulative self self total
time seconds seconds calls s/call s/call name
14.33 8.97 4.06 75669549 0.00 0.00 std::vector<int,
std::allocator<int> >::vector(std::vector<int, std::allocator<int> > const&)
I am having a little trouble understanding this line. I have several
functions that are my_func(const vector<int>& my_vec,...). My reasoning was
that the function wouldn't copy the column vector into the parameter in this
case, thus saving me time. But it looks like something is showing up in the
profile.
Can anyone explain to me what might be happening here? I am better that
there is actually a simple fix to avoid spending 14% of my algorithm in this
function...
Thanks so much for any comments that anyone might have!
--
View this message in context: http://www.nabble.com/Optimizing-using-grof%2C-interpreting-flat-profile--tp24156371p24156371.html
Sent from the gcc - Help mailing list archive at Nabble.com.