From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 26 05:15:31 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC0DB106564A for ; Wed, 26 Jan 2011 05:15:30 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9966D8FC0C for ; Wed, 26 Jan 2011 05:15:30 +0000 (UTC) Received: by vws9 with SMTP id 9so272350vws.13 for ; Tue, 25 Jan 2011 21:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=+KIp9PFDPoud5qTW0o8fVeLIMNLgII8f1YBEwtR/CIM=; b=Ph5DYpHvWfhdgzPNNvzo5/o7j7mMDnfSjSneeBGUEHsekpuYj/JM4mRK76f++2Xt5q HougKL42GR5mYVjL4b7OMkDjuszWz+1WfR97al6qYWVj6eGuycpe8cX/MN/7pdRcQ+6Y m0bht3qKvm8Q9o5e2/dEURNIJ0pWlwrFSedKU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=rjNnSUTdp0l3dlYb6cD6/vNDSl84mvQC23xmtYxjC3CEO2gbG+z6H4rgNW2yRPuho9 65fg5GAXzBoZDiS8oRNzaTskFEyRQr3vBuCX69bZAwXt5wQ5gWFrJvrikBqQUzEjRxZQ 6mwbWDUrOWm7OwYb7qkZgdCAKXieY5TFoSuco= Received: by 10.220.190.193 with SMTP id dj1mr1306420vcb.221.1296017365001; Tue, 25 Jan 2011 20:49:25 -0800 (PST) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id h18sm6532782vbr.14.2011.01.25.20.49.22 (version=SSLv3 cipher=RC4-MD5); Tue, 25 Jan 2011 20:49:23 -0800 (PST) Date: Tue, 25 Jan 2011 23:49:11 -0500 From: Alexander Kabaev To: Mark Saad Message-ID: <20110125234911.223d8f75@kan.dnsalias.net> In-Reply-To: References: X-Mailer: Claws Mail 3.7.8 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/qv9ymm95AA3elad7fvJWoMH"; protocol="application/pgp-signature" Cc: freebsd-hackers@freebsd.org Subject: Re: rtld optimizations X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 05:15:31 -0000 --Sig_/qv9ymm95AA3elad7fvJWoMH Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 25 Jan 2011 21:40:42 -0500 Mark Saad wrote: > Hello Hackers >=20 > The NetBSD folks have a nice improvement with the rtld-elf subsystem, > known as "Negative Symbol Cache" . >=20 > http://blog.netbsd.org/tnf/entry/netbsd_runtime_linker_gains_negative >=20 > Roy Marples roy@ has a simple write up of the change. >=20 > I took the basic idea from FreeBSD, but improved the performance > drastically. Basically, the huge win is by caching both breadth and > depth of the needed/weak symbol lookup. > Easiest to think of a,b,c,d as a matrix and FreeBSD just cache a row > where we cache both rows and columns. >=20 > Has anyone looked into porting the changes back to FreeBSD ? The > improvement on load time for things like firefox, openoffice, and java > is huge on NetBSD. It looks like this change could improve load times > on FreeBSD in the same ways. >=20 This is a second time someone posts this to public mailing list and curiously enough is a second time it suggested that someone else is to do the investigation. From the quick look, the commit in question is more or less a direct rip-off of Donelists we had for ages and as such is completely over-hyped. The only extra quirk that said commit does is an optimization of a dlsym() call, which is hardly ever in critical performance path. Said optimization is trivial and easy to try. Here you have it: http://people.freebsd.org/~kan/rtld-symlook-depth.diff Since it only applies to dlsym, it only affects programs that are heavy plugin users, which I suppose is the category OpenOffice and firefox both fall into. Care to do some benchmarks with and without the patch and report the results? I frankly doubt that you'll see any noticeable difference compared to our stock rtld's performance. --=20 Alexander Kabaev --Sig_/qv9ymm95AA3elad7fvJWoMH Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iD8DBQFNP6fMQ6z1jMm+XZYRApDcAJ9Qo4tdIl4xVxTwK+k61vAWxX7ZFwCeJNbs 9Bha2Y0q9hEBtn/L7WpwA2E= =0nHC -----END PGP SIGNATURE----- --Sig_/qv9ymm95AA3elad7fvJWoMH--