emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: --with-wide-int


From: Paul Eggert
Subject: Re: --with-wide-int
Date: Sun, 27 Nov 2011 23:56:29 -0800
User-agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]