From owner-freebsd-questions@FreeBSD.ORG Tue Aug 31 13:54:48 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B35210656B1 for ; Tue, 31 Aug 2010 13:54:48 +0000 (UTC) (envelope-from cbergstrom@pathscale.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 24C2C8FC13 for ; Tue, 31 Aug 2010 13:54:47 +0000 (UTC) Received: by fxm4 with SMTP id 4so4558411fxm.13 for ; Tue, 31 Aug 2010 06:54:47 -0700 (PDT) Received: by 10.223.116.193 with SMTP id n1mr5441605faq.77.1283262887102; Tue, 31 Aug 2010 06:54:47 -0700 (PDT) Received: from [192.168.5.149] ([119.42.86.73]) by mx.google.com with ESMTPS id m17sm391370fag.0.2010.08.31.06.54.39 (version=SSLv3 cipher=RC4-MD5); Tue, 31 Aug 2010 06:54:45 -0700 (PDT) Message-ID: <4C7D09BC.7050806@pathscale.com> Date: Tue, 31 Aug 2010 20:55:08 +0700 From: =?UTF-8?B?IkMuIEJlcmdzdHLDtm0i?= User-Agent: Thunderbird 2.0.0.22 (X11/20090909) MIME-Version: 1.0 To: Ivan Voras References: <4C7CF944.7030709@netfence.it> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Speeding up (caching?) shared libraries loading X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 Aug 2010 13:54:48 -0000 Ivan Voras wrote: > On 08/31/10 14:44, Andrea Venturoli wrote: >> Hello. >> >> Suppose I have an executable which I need to invoke repeatedly (e.g. to >> run tests in a makefile). >> This executables spend most of its time loading (rather than >> processing), due to the need of several huge shared libraries. >> >> I'd welcome an hint on how to speed this up. >> Possible thing would be to "cache" these shared libraries (and possibily >> the executable too) in memory, so that any invocation after the first is >> faster. >> Is this possible at all? > > Normal file system caching will cover this case (unless you have very > little memory available). The only other thing you might do to speed > this up is prebinding / prelinking but if you are often rebuilding the > project it might not help. With the PathScale compiler we tightly integrate hugetblfs support on linux. (At some point we'll likely adapt this approach to work with FBSD superpages) It can provide significant speed-up in some cases. (Like the initial loading of Firefox and some SPEC benchmarks) I would give that a try and see what sort of results you get.. (Not exactly what you were asking about, but could help)