From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Conservative scanning (was: Re: How and when to use GCPRO?) Date: Mon, 27 Dec 2010 20:36:35 -0800 Message-ID: <4D196953.4020907@gmail.com> References: <4D193E60.8070108@gmail.com> <4D195B6D.2060305@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig795DE12B4A71F1C9C3197E4A" X-Trace: dough.gmane.org 1293511014 24677 80.91.229.12 (28 Dec 2010 04:36:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 28 Dec 2010 04:36:54 +0000 (UTC) Cc: Andreas Schwab , Leo , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 28 05:36:49 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PXRIl-0000DS-Tx for ged-emacs-devel@m.gmane.org; Tue, 28 Dec 2010 05:36:48 +0100 Original-Received: from localhost ([127.0.0.1]:43871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXRIl-0001HT-EK for ged-emacs-devel@m.gmane.org; Mon, 27 Dec 2010 23:36:47 -0500 Original-Received: from [140.186.70.92] (port=43423 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PXRIg-0001HN-LN for emacs-devel@gnu.org; Mon, 27 Dec 2010 23:36:43 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PXRIf-00054p-Fu for emacs-devel@gnu.org; Mon, 27 Dec 2010 23:36:42 -0500 Original-Received: from mail-pw0-f41.google.com ([209.85.160.41]:63479) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PXRIf-00054k-A3 for emacs-devel@gnu.org; Mon, 27 Dec 2010 23:36:41 -0500 Original-Received: by pwj8 with SMTP id 8so1351401pwj.0 for ; Mon, 27 Dec 2010 20:36:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type; bh=fnFGu+UCNR3KHSZ15vjZGDSrKx3nQsRLbj+rFSNZs3k=; b=Mtt81MW35qsjvUgi0xcsS6hInq3D+XeTsN3Ov5psJyPMj+GrcT77onXyWXw3yp3J4E GYW1NvtM9pl4by5tIapgblsGsfIVvFUy3kjlZEQZqwcnQnnKyuuJq5anZwOBdggXtHyH 4fJrZ4dQUgRpq0MSdFTSD6ySnJlXCSFm9i5T8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type; b=hXCdVd0yb5TVSc9rXsPbuZlLoUGKOafkbAwWF2SvJadcKUul6JLaTwJRzMkMnOeWov /uuzMjXC4IEKvvOWTTpXt3NWtmah8q5fa+9lZmTX943vgowkDo328BBD/fiIoHO4Xahu KjtFKkUd/1ND2Rp26z9Ws9rUJdpcGqxcSwCnM= Original-Received: by 10.143.28.21 with SMTP id f21mr10658037wfj.259.1293511000394; Mon, 27 Dec 2010 20:36:40 -0800 (PST) Original-Received: from edith.local (c-67-183-23-114.hsd1.wa.comcast.net [67.183.23.114]) by mx.google.com with ESMTPS id w22sm18678550wfd.7.2010.12.27.20.36.39 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 27 Dec 2010 20:36:39 -0800 (PST) User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 In-Reply-To: X-Enigmail-Version: 1.1.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133999 Archived-At: This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig795DE12B4A71F1C9C3197E4A Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 12/27/10 8:15 PM, Stefan Monnier wrote: >> Hrm. You learn something every day --- I thought Emacs was doing preci= se >> GC the way it has since time immemorial. How much of a win was the >> GC_MARK_STACK conservative scanning approach? >=20 > As long as we still support platforms that use GCPROs, it's not a win > at all. Tho it may have beneficial effects on the performance, I don't= > know (it could also be detrimental to performance, by the way, because > of extra work it has to do every time we allocate memory for Lisp > objects in order to later on be able to conservatively tell whether an > integer happens to point to an allocated memory area). >=20 >=20 > Stefan Of course, since insertion in a RB tree is O(log N), N here being the number of allocated memory blocks, my gut tells me that consing time isn't hurt all that much. The whole approach basically moves work from the whole runtime (in the form of GCPRO) to allocation and deallocation. I don't know whether that's a win. Why bother with the conservative scanning at all? If it's on by default almost everywhere, then it might be hiding the presence of GCPRO bugs. Conservative scanning seems more useful as a debugging aide (GC_MARK_STACK_CHECK_GCPROS and CHECK_ZOMBIES) than as the primary GC strategy. Usually, conservative GC is what you do when there's not enough information for precise GC, but that's not the case in the Emacs core. Has anyone run benchmarks lately? Eight years is a long time. --------------enig795DE12B4A71F1C9C3197E4A Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) iEYEARECAAYFAk0ZaVYACgkQ17c2LVA10VssIQCgvzdEvXM/1BeWbTJ43MuEnRED lY8AoLmwdD5Y48kAa3BWvCIsLlR2+joe =bV6e -----END PGP SIGNATURE----- --------------enig795DE12B4A71F1C9C3197E4A--