unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Dmitry Antipov <antipov@mvista.com>, emacs-devel@gnu.org
Subject: Re: --with-wide-int
Date: Sun, 27 Nov 2011 23:56:29 -0800	[thread overview]
Message-ID: <4ED33EAD.5040104@cs.ucla.edu> (raw)
In-Reply-To: <jwvmxbggaig.fsf-monnier+emacs@gnu.org>

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).



  reply	other threads:[~2011-11-28  7:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-26  2:15 immediate strings Dmitry Antipov
2011-11-26  7:56 ` Andreas Schwab
2011-11-26  8:05 ` Paul Eggert
2011-11-26 10:03   ` Eli Zaretskii
2011-11-26 14:28     ` Stefan Monnier
2011-11-26 14:30   ` Dmitry Antipov
2011-11-26 21:13     ` Paul Eggert
2011-11-28  4:19       ` --with-wide-int Stefan Monnier
2011-11-28  7:56         ` Paul Eggert [this message]
2011-11-28 16:52           ` --with-wide-int Stefan Monnier
2011-11-28 18:04             ` --with-wide-int Dan Nicolaescu
2011-11-28 18:34               ` --with-wide-int Eli Zaretskii
2011-11-28 19:35               ` --with-wide-int Stefan Monnier
2011-11-29  4:26                 ` --with-wide-int Stephen J. Turnbull
2011-11-29  7:35             ` --with-wide-int Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED33EAD.5040104@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=antipov@mvista.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).