From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Antipov Newsgroups: gmane.emacs.devel Subject: Re: Your Emacs changes Date: Tue, 21 Aug 2007 18:42:20 +0400 Message-ID: <46CAF9CC.6030308@yandex.ru> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040802050101020103000601" X-Trace: sea.gmane.org 1187707728 31207 80.91.229.12 (21 Aug 2007 14:48:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Aug 2007 14:48:48 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 21 16:48:44 2007 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.50) id 1INV2A-0002s9-1P for ged-emacs-devel@m.gmane.org; Tue, 21 Aug 2007 16:48:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INV29-0005kh-BH for ged-emacs-devel@m.gmane.org; Tue, 21 Aug 2007 10:48:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1INV25-0005kK-LP for emacs-devel@gnu.org; Tue, 21 Aug 2007 10:48:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1INV24-0005k3-4U for emacs-devel@gnu.org; Tue, 21 Aug 2007 10:48:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1INV23-0005ju-SH for emacs-devel@gnu.org; Tue, 21 Aug 2007 10:48:35 -0400 Original-Received: from smtp4.yandex.ru ([213.180.223.136]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1INV22-0006aT-Gm; Tue, 21 Aug 2007 10:48:34 -0400 Original-Received: from rtsoft2.corbina.net ([85.21.88.2]:55505 "EHLO localhost.localdomain" smtp-auth: "dmantipov" TLS-CIPHER: TLS-PEER-CN1: ) by mail.yandex.ru with ESMTP id S737573AbXHUOqC (ORCPT + 1 other); Tue, 21 Aug 2007 18:46:02 +0400 X-Comment: RFC 2476 MSA function at smtp4.yandex.ru logged sender identity as: dmantipov User-Agent: Thunderbird 2.0.0.5 (X11/20070719) In-Reply-To: X-Detected-Kernel: Linux 2.6 (newer, 1) 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:76890 Archived-At: This is a multi-part message in MIME format. --------------040802050101020103000601 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Richard Stallman wrote: > Now that we have your papers, what changes should we install now? Probably the thing described at http://lists.gnu.org/archive/html/emacs-devel/2007-07/msg00094.html. Attached is the latest stuff on this. Note the same optimization may be performed on sweeping floats. But, since an amount of allocated floats is too small in comparison with conses, an effect is expected to be very negligible. Dmitry --------------040802050101020103000601 Content-Type: text/x-patch; name="fast_cons_sweep.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fast_cons_sweep.patch" Index: alloc.c =================================================================== RCS file: /sources/emacs/emacs/src/alloc.c,v retrieving revision 1.414 diff -u -r1.414 alloc.c --- alloc.c 19 Aug 2007 00:15:26 -0000 1.414 +++ alloc.c 21 Aug 2007 14:31:37 -0000 @@ -5974,23 +5974,53 @@ for (cblk = cons_block; cblk; cblk = *cprev) { - register int i; + register int i = 0; int this_free = 0; - for (i = 0; i < lim; i++) - if (!CONS_MARKED_P (&cblk->conses[i])) - { - this_free++; - cblk->conses[i].u.chain = cons_free_list; - cons_free_list = &cblk->conses[i]; + + while (1) + { + if (cblk->gcmarkbits[i] == -1) + { + /* Fast path - everything is marked. */ + cblk->gcmarkbits[i++] = 0; + num_used += BITS_PER_INT; + } + else + { + /* Slow path - scan over each bit, from the beginning + of current word to 'min (word boundary, LIM)'. */ + int start, stop; + + start = i * BITS_PER_INT; + stop = lim - start; + if (stop > BITS_PER_INT) + stop = BITS_PER_INT; + stop += start; + + while (start < stop) + { + if (!CONS_MARKED_P (&cblk->conses[start])) + { + this_free++; + cblk->conses[start].u.chain = cons_free_list; + cons_free_list = &cblk->conses[start]; #if GC_MARK_STACK - cons_free_list->car = Vdead; + cons_free_list->car = Vdead; #endif - } - else - { - num_used++; - CONS_UNMARK (&cblk->conses[i]); - } + } + else + { + num_used++; + CONS_UNMARK (&cblk->conses[start]); + } + start++; + } + if (stop < (++i) * BITS_PER_INT) + /* Whole bitmap is scanned or LIM is reached. */ + break; + } + } + lim = CONS_BLOCK_SIZE; /* If this block contains only free conses and we have already seen more than two blocks worth of free conses then deallocate --------------040802050101020103000601 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------040802050101020103000601--