From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Han-Wen Nienhuys Newsgroups: gmane.lisp.guile.devel Subject: Re: marking overhead, and on the cost of conditionals in hot code Date: Mon, 19 Jan 2009 01:35:53 -0200 Message-ID: References: Reply-To: hanwen@xs4all.nl NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1232336192 18611 80.91.229.12 (19 Jan 2009 03:36:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 19 Jan 2009 03:36:32 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jan 19 04:37:45 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LOkxL-00085W-Sj for guile-devel@m.gmane.org; Mon, 19 Jan 2009 04:37:44 +0100 Original-Received: from localhost ([127.0.0.1]:47904 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOkw0-0001B7-MR for guile-devel@m.gmane.org; Sun, 18 Jan 2009 22:36:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOkvv-0001B2-4x for guile-devel@gnu.org; Sun, 18 Jan 2009 22:36:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOkvs-0001Ap-N8 for guile-devel@gnu.org; Sun, 18 Jan 2009 22:36:13 -0500 Original-Received: from [199.232.76.173] (port=47695 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOkvs-0001Am-Gz for guile-devel@gnu.org; Sun, 18 Jan 2009 22:36:12 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:46419 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LOkvs-0006Ht-4j for guile-devel@gnu.org; Sun, 18 Jan 2009 22:36:12 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LOkvo-0002e4-Nm for guile-devel@gnu.org; Mon, 19 Jan 2009 03:36:08 +0000 Original-Received: from 201.80.70.195 ([201.80.70.195]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jan 2009 03:36:08 +0000 Original-Received: from hanwen by 201.80.70.195 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 19 Jan 2009 03:36:08 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 25 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 201.80.70.195 User-Agent: Thunderbird 2.0.0.19 (X11/20090105) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8057 Archived-At: Andy Wingo escreveu: > I dropped into cachegrind, and it tells me thing about scm_gc_mark in a > simple guile -c 1 run: > > > I think that the items on the left are cycle counts, and are of relative > importance. The => lines are the cumulative costs of the subroutines. > > The salient point for me is that the scm_i_marking check slows down > this function by about 10%! This can easily be remedied by splitting off the actual work into internal function which skips the check. The GC module could alway call the internal function. > Also, that the majority of the time in this > function is in the SCM_GC_MARK_P line. Well, GC_MARK_P is bit fiddling a pointer dereference, with a possible cache miss. Also, the code up to that point will get executed much more often than what follows. -- Han-Wen Nienhuys - hanwen@xs4all.nl - http://www.xs4all.nl/~hanwen