emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Re: Bignum performance (was: Shrinking the C core)


From: Gerd Möllmann
Subject: Re: [PATCH] Re: Bignum performance (was: Shrinking the C core)
Date: Mon, 14 Aug 2023 09:35:08 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0

On 14.08.23 09:04, Ihor Radchenko wrote:
Gerd Möllmann <gerd.moellmann@gmail.com> writes:

Just for the record, SBCL/CMUCL don't use GMP.

Hm, thinking of this - did someone measure how much time is spent in
malloc/realloc/free in the benchmarks?  That is what GMP uses, and SBCL
doesn't.

https://yhetil.org/emacs-devel/87bkfdsmde.fsf@localhost/

We can further get rid of the GC by temporarily disabling it (just for
demonstration):

(let ((beg (float-time)))
   (setq gc-cons-threshold most-positive-fixnum)
   (fib 10000 1000)
   (message "%.3f s" (- (float-time) beg)) )

perf record  ~/Git/emacs/src/emacs -Q -batch -l /tmp/fib.eln
0.739 s

     17.11%  emacs    libgmp.so.10.5.0      [.] __gmpz_sizeinbase
      7.35%  emacs    libgmp.so.10.5.0      [.] __gmpz_add
      6.51%  emacs    emacs                 [.] arith_driver
      6.03%  emacs    libc.so.6             [.] malloc
      5.57%  emacs    emacs                 [.] allocate_vectorlike
      5.20%  emacs    [unknown]             [k] 0xffffffffaae01857
      4.16%  emacs    libgmp.so.10.5.0      [.] __gmpn_add_n_coreisbr
      3.72%  emacs    emacs                 [.] check_number_coerce_marker
      3.35%  emacs    fib.eln               [.] F666962_fib_0
      3.29%  emacs    emacs                 [.] allocate_pseudovector
      2.30%  emacs    emacs                 [.] Flss

Hm, then maybe we can look at the disassembly of then benchmark in SBCL? Not that in the end the compiler is so smart that it optimizes a lot of stuff simply away because it can prove that the result of the computations cannot possibly be observed?



reply via email to

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