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: Proposal: block-based vector allocator Date: Fri, 01 Jun 2012 09:15:59 +0400 Message-ID: <4FC8500F.6000109@yandex.ru> References: <4EDDA68B.5050601@yandex.ru> <4FB4AFA4.7020601@yandex.ru> <4FBA32D9.5090704@yandex.ru> <4FC775B5.30904@yandex.ru> <4FC79188.4070200@cs.ucla.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338527638 9301 80.91.229.3 (1 Jun 2012 05:13:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jun 2012 05:13:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jun 01 07:13:58 2012 Return-path: Envelope-to: ged-emacs-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 1SaKBN-0003pU-RX for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2012 07:13:53 +0200 Original-Received: from localhost ([::1]:47156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaKBN-0005Ai-6R for ged-emacs-devel@m.gmane.org; Fri, 01 Jun 2012 01:13:53 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaKBK-0005AP-BS for emacs-devel@gnu.org; Fri, 01 Jun 2012 01:13:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SaKBH-0003sK-DW for emacs-devel@gnu.org; Fri, 01 Jun 2012 01:13:49 -0400 Original-Received: from forward11.mail.yandex.net ([95.108.130.93]:43568) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SaKBG-0003rk-VV for emacs-devel@gnu.org; Fri, 01 Jun 2012 01:13:47 -0400 Original-Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward11.mail.yandex.net (Yandex) with ESMTP id 54B45E812B0; Fri, 1 Jun 2012 09:13:45 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1338527625; bh=bzTbfr6EfRwY9DWSS4PpCkpPJFw5S8bpNl4ztKkNt5A=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=WGgqeFgKKopRlBc+h3TzjFG9FHIijGU+pKhFeYhJ+2y1qPjq7O5tETOAs9u0WVzL8 qtsOn9CUbZ/yuklgWE3pF290Ky08k9z3ZQ4rdkgq3nAv1daAY5IVe2jdp1fT9SLzSm 8EDUSC2STePeuDgFzMPadat9UdfHeZRTUevgut+A= Original-Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id 3248A1B60391; Fri, 1 Jun 2012 09:13:45 +0400 (MSK) Original-Received: from antipov.client.gelicon.ru (antipov.client.gelicon.ru [78.153.153.8]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id DiAicX4P-DjAKGlMb; Fri, 1 Jun 2012 09:13:45 +0400 X-Yandex-Rcpt-Suid: eggert@cs.ucla.edu X-Yandex-Rcpt-Suid: emacs-devel@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1338527625; bh=bzTbfr6EfRwY9DWSS4PpCkpPJFw5S8bpNl4ztKkNt5A=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=pgAmQWmJMZrFgcl8s2VTBuJSUIXmj2SBpZA/VyVMIOBe1HYU1h/pFacmzXlE/Le3h CP+kDigs4KKAnak6FuLGfOYUJRY7jkSGuYqUqxkZyfrXcPf6CeiEOc6ZhncRNsIMGV aTXMfrb8qchuI/yib8TlHCdIxfUxZqMSD0oTWlDw= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 In-Reply-To: <4FC79188.4070200@cs.ucla.edu> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 95.108.130.93 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:150706 Archived-At: On 05/31/2012 07:43 PM, Paul Eggert wrote: > Have you done some performance analysis on typical 64- and 32-bit hosts? Sure. > Has this been published somewhere? Should be in the ChangeLog entry or whatnot. I'll post it here, just after making them readable and comparable. >> + /* On a 32-bit system, rounding up vector size (in bytes) up >> + to mult-of-8 helps to maintain mult-of-8 alignment. */ >> + roundup_size = 8 > > This alignment is needed only if USE_LSB_TAG, right? If so, the > roundup should occur only on such hosts. It looks like you miss the core idea behind this code. The rounding is not just to force alignment. For the block-allocated vectors, this code rounds each possible vector size (in bytes) up to nearest mult-of-roundup_size bytes, and then uses (size / roundup_size) as an index into vector_free_lists. I believe this is the most natural way for both 32 and 64-bit systems with USE_LSB_TAG since it guarantees expected alignment by design. On non-USE_LSB_TAG system, roundup_size is orthogonal to pointer values (roundup_size can't be less than sizeof (Lisp_Object), of course). For example, 32-bit system (non-wide-int, i.e. sizeof (Lisp_Object) == 4) without USE_LSB_TAG is expected to work with roundup_size = 4, but I can't test this and have no ideas why it's worth trying at all. Dmitry