From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: --with-wide-int Date: Sun, 27 Nov 2011 23:56:29 -0800 Organization: UCLA Computer Science Department Message-ID: <4ED33EAD.5040104@cs.ucla.edu> References: <4ED04BBC.70803@yandex.ru> <4ED09DD4.1090201@cs.ucla.edu> <4ED0F7ED.8050700@yandex.ru> <4ED15672.9030600@cs.ucla.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1322467004 4400 80.91.229.12 (28 Nov 2011 07:56:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2011 07:56:44 +0000 (UTC) Cc: Dmitry Antipov , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 28 08:56:40 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RUw4s-0006Zy-PZ for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2011 08:56:38 +0100 Original-Received: from localhost ([::1]:50659 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUw4s-0007lw-9m for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2011 02:56:38 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:58973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUw4k-0007kJ-EF for emacs-devel@gnu.org; Mon, 28 Nov 2011 02:56:35 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RUw4j-0001wG-3t for emacs-devel@gnu.org; Mon, 28 Nov 2011 02:56:30 -0500 Original-Received: from smtp.cs.ucla.edu ([131.179.128.62]:55414) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RUw4i-0001w4-Pp for emacs-devel@gnu.org; Mon, 28 Nov 2011 02:56:29 -0500 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 89FDBA60002; Sun, 27 Nov 2011 23:56:26 -0800 (PST) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Original-Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LeUCnYvap7tQ; Sun, 27 Nov 2011 23:56:26 -0800 (PST) Original-Received: from [192.168.1.10] (pool-71-189-109-235.lsanca.fios.verizon.net [71.189.109.235]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id DDB5BA60001; Sun, 27 Nov 2011 23:56:25 -0800 (PST) User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 131.179.128.62 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:146294 Archived-At: On 11/27/11 20:19, Stefan Monnier wrote: > So I expect the practical limit to be closer to 1GB. In practice the limit is a bit less than 2 GiB if you're editing one big file. (I observed this just now, on Ubuntu 11.10 x86, by editing a 1947957328-byte text file.) Simple edits and incremental searches are fast; more complicated stuff can be slow (as is reading or writing the entire file to disk), but this is no different from a 64-bit host. Emacs's use of ptrdiff_t imposes a hard limit of just under 2 GiB on a 32-bit host. The OS may impose its own limit but it's not uncommon for it to behave like Ubuntu. If you want to edit many large files, of course, you're out of luck, as the limit is at most ~ 4 GiB virtual memory total and you'll suffer from fragmentation anyway. Still, it's useful to be able to edit one ~ 2 GiB file in Emacs, as opposed to being stuck with a limit of ~ 500 MiB for that file. --with-wide-int is not simply about having bigger buffers. It's also about having bigger integers, which is a win in some important cases. GNU Calc runs a lot faster, for example. On this benchmark: (load-library "calc") (load-library "calc-ext") (load-library "benchmark") (calc-working 0) (benchmark-run 1 (math-numdigs (math-pow 2 (math-pow 2 16)))) Emacs is 3.9x faster on my Ubuntu 11.10 x86 host when it is configured --with-wide-int (6.601589 seconds normally, and 1.676254 seconds --with-wide-int).