all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org
Subject: Re: Lisp_Marker size on 32bit systems
Date: Fri, 7 Sep 2018 14:03:44 -0700	[thread overview]
Message-ID: <d2371731-bcc0-95f5-b809-f51d42da33ad@cs.ucla.edu> (raw)
In-Reply-To: <jwvr2i5qg8c.fsf-monnier+emacs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1053 bytes --]

Stefan Monnier wrote:

> I still wonder why it would be slower at all.

My guess is cache effects. My processor has a cache line size of 64 bytes, so if 
objects are allocated in 32-byte chunks they won't straddle cache boundaries and 
code will be less likely to thrash the cache. I ran this benchmark in the 'lisp' 
subdirectory:

EMACSLOADPATH= perf stat -dd '../src/emacs' -batch --no-site-file --no-site-lisp 
--eval '(setq load-prefer-newer t)'  -f batch-byte-compile org/org.el

and am attaching the results for the 24-bit allocation (a bit slower) and the 
32-bit allocation (a bit faster), and they are in line with this guess.

>> Maybe we should be using 4 mark bits instead of 3?
> On 32bit systems, both cons cells and float cells use 8 bytes each, so
> aligning on multiples of 16 would double their memory use.

We'd use two tags for both conses and float cells, so that shouldn't be a problem.

> it's not clear
> what the extra tags would be useful for.

Presumably to help performance elsewhere. Admittedly I'm blue-skying a bit here.

[-- Attachment #2: perf-stat-emacs-24.txt --]
[-- Type: text/plain, Size: 2140 bytes --]


 Performance counter stats for '../src/emacs -batch --no-site-file --no-site-lisp --eval (setq load-prefer-newer t) -f batch-byte-compile org/org.el':

       3710.809824      task-clock:u (msec)       #    0.998 CPUs utilized          
                 0      context-switches:u        #    0.000 K/sec                  
                 0      cpu-migrations:u          #    0.000 K/sec                  
             4,298      page-faults:u             #    0.001 M/sec                  
     9,414,411,487      cycles:u                  #    2.537 GHz                      (18.79%)
       757,273,968      stalled-cycles-frontend:u #    8.04% frontend cycles idle     (18.80%)
     4,395,722,568      stalled-cycles-backend:u  #   46.69% backend cycles idle      (18.80%)
     9,301,424,026      instructions:u            #    0.99  insn per cycle         
                                                  #    0.47  stalled cycles per insn  (18.79%)
     1,390,988,726      branches:u                #  374.848 M/sec                    (18.76%)
        67,045,930      branch-misses:u           #    4.82% of all branches          (18.74%)
     5,219,768,450      L1-dcache-loads:u         # 1406.639 M/sec                    (18.73%)
        43,583,947      L1-dcache-load-misses:u   #    0.83% of all L1-dcache hits    (18.72%)
        85,736,523      LLC-loads:u               #   23.105 M/sec                    (18.73%)
        14,635,030      LLC-load-misses:u         #   17.07% of all LL-cache hits     (18.73%)
     2,429,036,804      L1-icache-loads:u         #  654.584 M/sec                    (18.73%)
         7,260,772      L1-icache-load-misses:u   #    0.30% of all L1-icache hits    (18.72%)
     5,206,401,315      dTLB-loads:u              # 1403.036 M/sec                    (18.72%)
         4,878,637      dTLB-load-misses:u        #    0.09% of all dTLB cache hits   (18.72%)
     2,418,273,074      iTLB-loads:u              #  651.683 M/sec                    (18.75%)
             2,946      iTLB-load-misses:u        #    0.00% of all iTLB cache hits   (18.77%)

       3.718081199 seconds time elapsed


[-- Attachment #3: perf-stat-emacs-32.txt --]
[-- Type: text/plain, Size: 2140 bytes --]


 Performance counter stats for '../src/emacs -batch --no-site-file --no-site-lisp --eval (setq load-prefer-newer t) -f batch-byte-compile org/org.el':

       3643.107970      task-clock:u (msec)       #    0.998 CPUs utilized          
                 0      context-switches:u        #    0.000 K/sec                  
                 0      cpu-migrations:u          #    0.000 K/sec                  
             4,320      page-faults:u             #    0.001 M/sec                  
     9,235,689,147      cycles:u                  #    2.535 GHz                      (18.77%)
       683,279,700      stalled-cycles-frontend:u #    7.40% frontend cycles idle     (18.74%)
     4,395,369,277      stalled-cycles-backend:u  #   47.59% backend cycles idle      (18.73%)
     9,226,971,053      instructions:u            #    1.00  insn per cycle         
                                                  #    0.48  stalled cycles per insn  (18.74%)
     1,360,574,869      branches:u                #  373.465 M/sec                    (18.75%)
        68,352,263      branch-misses:u           #    5.02% of all branches          (18.75%)
     5,125,592,214      L1-dcache-loads:u         # 1406.928 M/sec                    (18.74%)
        41,529,042      L1-dcache-load-misses:u   #    0.81% of all L1-dcache hits    (18.74%)
        77,752,725      LLC-loads:u               #   21.342 M/sec                    (18.74%)
        14,778,615      LLC-load-misses:u         #   19.01% of all LL-cache hits     (18.75%)
     2,394,079,664      L1-icache-loads:u         #  657.153 M/sec                    (18.74%)
         6,663,498      L1-icache-load-misses:u   #    0.28% of all L1-icache hits    (18.74%)
     5,164,701,717      dTLB-loads:u              # 1417.664 M/sec                    (18.74%)
         4,443,995      dTLB-load-misses:u        #    0.09% of all dTLB cache hits   (18.76%)
     2,345,758,968      iTLB-loads:u              #  643.889 M/sec                    (18.78%)
             3,369      iTLB-load-misses:u        #    0.00% of all iTLB cache hits   (18.79%)

       3.650332037 seconds time elapsed


  reply	other threads:[~2018-09-07 21:03 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-06  0:41 Lisp_Marker size on 32bit systems Stefan Monnier
2018-09-06  6:51 ` Paul Eggert
2018-09-06 12:17   ` Stefan Monnier
2018-09-07  7:15     ` Paul Eggert
2018-09-07  8:05       ` Eli Zaretskii
2018-09-07 13:45         ` Paul Eggert
2018-09-07 14:12           ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Stefan Monnier
2018-09-07 14:23             ` Eli Zaretskii
2018-09-07 15:16             ` GDB and compiler-operations Andreas Schwab
2018-09-07 15:48             ` GDB and compiler-operations (was: Lisp_Marker size on 32bit systems) Paul Eggert
2018-09-07 15:58               ` GDB and compiler-operations Stefan Monnier
2018-09-07 17:11                 ` Eli Zaretskii
2018-09-07 17:15                 ` Paul Eggert
2018-09-07 19:59             ` Tom Tromey
2018-09-07 14:19           ` Lisp_Marker size on 32bit systems Eli Zaretskii
2018-09-07 16:27             ` Paul Eggert
2018-09-07 17:16               ` Eli Zaretskii
2018-09-07 18:13                 ` Paul Eggert
2018-09-07 18:32                   ` Eli Zaretskii
2018-09-07 19:05                     ` Paul Eggert
2018-09-07 19:22                       ` Eli Zaretskii
2018-09-07 12:16       ` Stefan Monnier
2018-09-07 19:04         ` Paul Eggert
2018-09-07 19:45           ` Stefan Monnier
2018-09-07 21:03             ` Paul Eggert [this message]
2018-09-08  1:54               ` Stefan Monnier
2018-09-08  3:04                 ` Paul Eggert
2018-09-08  3:10                   ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=d2371731-bcc0-95f5-b809-f51d42da33ad@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.