From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Optimizing vlists Date: Mon, 13 Aug 2012 18:47:16 +0200 Message-ID: <87wr1220yz.fsf_-_@gnu.org> References: <5024F643.8040706@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1344876454 20059 80.91.229.3 (13 Aug 2012 16:47:34 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Aug 2012 16:47:34 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Aug 13 18:47:35 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T0xnh-0007bP-ID for guile-devel@m.gmane.org; Mon, 13 Aug 2012 18:47:33 +0200 Original-Received: from localhost ([::1]:50857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0xng-0004lx-K1 for guile-devel@m.gmane.org; Mon, 13 Aug 2012 12:47:32 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0xne-0004lR-AZ for guile-devel@gnu.org; Mon, 13 Aug 2012 12:47:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T0xnb-0005j5-KX for guile-devel@gnu.org; Mon, 13 Aug 2012 12:47:30 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:51425) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T0xnb-0005hX-DU for guile-devel@gnu.org; Mon, 13 Aug 2012 12:47:27 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1T0xnZ-0007KO-3o for guile-devel@gnu.org; Mon, 13 Aug 2012 18:47:25 +0200 Original-Received: from 193.50.110.192 ([193.50.110.192]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Aug 2012 18:47:25 +0200 Original-Received: from ludo by 193.50.110.192 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Aug 2012 18:47:25 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.192 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 27 Thermidor an 220 de la =?iso-8859-1?Q?R=E9volutio?= =?iso-8859-1?Q?n?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.1 (gnu/linux) Cancel-Lock: sha1:daNeNEPkqxinolIbrpbSuaDzpmo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:14801 Archived-At: Hello, Mark H Weaver skribis: > Here's one specific data structure idea: we have a "vlist" data > structure, currently written in Scheme, but in my opinion it would be > useful to rewrite it in C for better efficiency. FWIW, I’m not convinced that this is a fruitful approach. First, because Guile 2.0 has allowed us to write more things in Scheme, and I’d like to keep it this way. ;-) Second, because a very important optimizations would rather be to fiddle with the GC so that vlists, which are base + offset pairs, would not have to be heap-allocated, as vlist.scm says: ;; XXX: Allocating a record in addition to the block at each ;; `vlist-cons' call is inefficient. However, Bagwell's hack to avoid it ;; (Section 2.2) would require GC_ALL_INTERIOR_POINTERS, which would be a ;; performance hit for everyone. I remember Andy did some measurements showing that ‘vhash-assoc’ was often high in the profile when running the compiler. One thing that could be done is to run a C-level profiler to see exactly what’s going on, and which optimizations could help. WDYT? Thanks, Ludo’.