From owner-freebsd-toolchain@FreeBSD.ORG Sun Sep 15 09:33:18 2013 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 0CF32F27 for ; Sun, 15 Sep 2013 09:33:18 +0000 (UTC) (envelope-from kamikaze@bsdforen.de) Received: from mail.server1.bsdforen.de (bsdforen.de [82.193.243.81]) by mx1.freebsd.org (Postfix) with ESMTP id C553927D1 for ; Sun, 15 Sep 2013 09:33:17 +0000 (UTC) Received: from mobileKamikaze.norad (HSI-KBW-134-3-231-194.hsi14.kabel-badenwuerttemberg.de [134.3.231.194]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.server1.bsdforen.de (Postfix) with ESMTPSA id 1AEB8861C5 for ; Sun, 15 Sep 2013 11:26:33 +0200 (CEST) Message-ID: <52357D49.5020907@bsdforen.de> Date: Sun, 15 Sep 2013 11:26:33 +0200 From: Dominic Fandrey MIME-Version: 1.0 To: freebsd-toolchain@freebsd.org Subject: Profiling with clang Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Sep 2013 09:33:18 -0000 Recently I've been using profiling with c++ -pg a lot. I'm developing a simulation and have been able to more than double the performance, just by focusing my attention on the top functions listed in the profile. Inlining them, optimising them or finding ways to call them less often. Even though I use clang as my compiler, for profiling I have to refer to the old gcc42. Is there any work on making profiling work with clang? On a side node, clang and gcc47 from ports produce equally fast binaries (there is literally no difference outside of the error margin). For both clang and gcc47 -O3 binaries are not faster than -O2 binaries. They used to be slower, when the code was less polished. -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?