From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17343 invoked by alias); 28 Jan 2011 08:00:53 -0000 Received: (qmail 17331 invoked by uid 22791); 28 Jan 2011 08:00:52 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-ey0-f175.google.com (HELO mail-ey0-f175.google.com) (209.85.215.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 28 Jan 2011 08:00:48 +0000 Received: by eya28 with SMTP id 28so1403935eya.20 for ; Fri, 28 Jan 2011 00:00:45 -0800 (PST) Received: by 10.213.27.78 with SMTP id h14mr4366663ebc.17.1296201645857; Fri, 28 Jan 2011 00:00:45 -0800 (PST) Received: from [192.168.1.3] ([93.157.232.12]) by mx.google.com with ESMTPS id x54sm13637421eeh.23.2011.01.28.00.00.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Jan 2011 00:00:44 -0800 (PST) Message-ID: <4D4277B9.7040707@gmail.com> Date: Fri, 28 Jan 2011 08:34:00 -0000 From: "Vyacheslav V. Yurkov" User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100401 Thunderbird/3.0.4 MIME-Version: 1.0 To: Anna Sidera CC: gcc-help@gcc.gnu.org Subject: Re: where my program spends time? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-01/txt/msg00432.txt.bz2 On 28.01.2011 10:23, Anna Sidera wrote: > Hello, > > I wrote a simulation program in gcc that takes 12 hours to finish and I want to make it faster. Can you tell me any way to find what proportion of the time is spend in each line of the program? (like profile in matlab) > > Thanks, > Anna > > Hi Anna, Use valgrind (cachegrind) and/or oprofile. Note that under profiler program runs 20 - 100 times slower. -- Yours sincerely, Vyacheslav V. Yurkov