emacs-devel
[Top][All Lists]
Advanced

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

Re: Using __builtin_expect (likely/unlikely macros)


From: Alex Gramiak
Subject: Re: Using __builtin_expect (likely/unlikely macros)
Date: Tue, 16 Apr 2019 15:11:58 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Alex Gramiak <address@hidden> writes:
> Perhaps I was too overzealous with the hot tagging?

I definitely was, since I removed the _Hot attributes from the
*malloc/free procedures, which turned out to be in bad judgment.
Removing those yielded:

 Performance counter stats for 'src/emacs.hot-cold -f kill-emacs' (20 runs):

            751.22 msec task-clock:u              #    0.841 CPUs utilized      
      ( +-  0.14% )
                 0      context-switches:u        #    0.000 K/sec              
    
                 0      cpu-migrations:u          #    0.000 K/sec              
    
            12,928      page-faults:u             #    0.017 M/sec              
      ( +-  0.02% )
     2,959,142,867      cycles:u                  #    3.939 GHz                
      ( +-  0.05% )
     1,350,640,657      stalled-cycles-frontend:u #   45.64% frontend cycles 
idle     ( +-  0.12% )
       972,612,724      stalled-cycles-backend:u  #   32.87% backend cycles 
idle      ( +-  0.15% )
     4,865,119,525      instructions:u            #    1.64  insn per cycle     
    
                                                  #    0.28  stalled cycles per 
insn  ( +-  0.00% )
     1,035,582,401      branches:u                # 1378.539 M/sec              
      ( +-  0.00% )
        17,794,068      branch-misses:u           #    1.72% of all branches    
      ( +-  0.14% )
     1,206,398,515      L1-dcache-loads:u         # 1605.925 M/sec              
      ( +-  0.00% )
        42,095,141      L1-dcache-load-misses:u   #    3.49% of all L1-dcache 
hits    ( +-  0.05% )
         9,057,830      LLC-loads:u               #   12.058 M/sec              
      ( +-  0.39% )
   <not supported>      LLC-load-misses:u                                       
    

           0.89309 +- 0.00484 seconds time elapsed  ( +-  0.54% )

I also realized that I completely forgot putting the attribute on
emacs_abort. With the _Cold attribute on emacs_abort:


 Performance counter stats for 'src/emacs -f kill-emacs' (20 runs):

            760.73 msec task-clock:u              #    0.846 CPUs utilized      
      ( +-  0.22% )
                 0      context-switches:u        #    0.000 K/sec              
    
                 0      cpu-migrations:u          #    0.000 K/sec              
    
            12,925      page-faults:u             #    0.017 M/sec              
      ( +-  0.02% )
     2,991,729,656      cycles:u                  #    3.933 GHz                
      ( +-  0.04% )
     1,388,332,047      stalled-cycles-frontend:u #   46.41% frontend cycles 
idle     ( +-  0.13% )
       976,840,303      stalled-cycles-backend:u  #   32.65% backend cycles 
idle      ( +-  0.17% )
     4,867,077,504      instructions:u            #    1.63  insn per cycle     
    
                                                  #    0.29  stalled cycles per 
insn  ( +-  0.00% )
     1,036,158,051      branches:u                # 1362.059 M/sec              
      ( +-  0.00% )
        17,860,346      branch-misses:u           #    1.72% of all branches    
      ( +-  0.19% )
     1,207,924,887      L1-dcache-loads:u         # 1587.852 M/sec              
      ( +-  0.00% )
        42,358,754      L1-dcache-load-misses:u   #    3.51% of all L1-dcache 
hits    ( +-  0.06% )
         9,046,859      LLC-loads:u               #   11.892 M/sec              
      ( +-  0.32% )
   <not supported>      LLC-load-misses:u                                       
    

           0.89896 +- 0.00200 seconds time elapsed  ( +-  0.22% )


 Performance counter stats for 'src/emacs.cold -f kill-emacs' (20 runs):

            755.78 msec task-clock:u              #    0.845 CPUs utilized      
      ( +-  0.18% )
                 0      context-switches:u        #    0.000 K/sec              
    
                 0      cpu-migrations:u          #    0.000 K/sec              
    
            12,929      page-faults:u             #    0.017 M/sec              
      ( +-  0.02% )
     2,978,556,838      cycles:u                  #    3.941 GHz                
      ( +-  0.05% )
     1,370,387,120      stalled-cycles-frontend:u #   46.01% frontend cycles 
idle     ( +-  0.12% )
       978,514,384      stalled-cycles-backend:u  #   32.85% backend cycles 
idle      ( +-  0.16% )
     4,866,672,758      instructions:u            #    1.63  insn per cycle     
    
                                                  #    0.28  stalled cycles per 
insn  ( +-  0.00% )
     1,035,997,172      branches:u                # 1370.762 M/sec              
      ( +-  0.00% )
        17,838,674      branch-misses:u           #    1.72% of all branches    
      ( +-  0.13% )
     1,206,937,944      L1-dcache-loads:u         # 1596.939 M/sec              
      ( +-  0.00% )
        42,110,067      L1-dcache-load-misses:u   #    3.49% of all L1-dcache 
hits    ( +-  0.05% )
         9,088,714      LLC-loads:u               #   12.026 M/sec              
      ( +-  0.28% )
   <not supported>      LLC-load-misses:u                                       
    

           0.89401 +- 0.00185 seconds time elapsed  ( +-  0.21% )



 Performance counter stats for 'src/emacs.hot-cold -f kill-emacs' (20 runs):

            752.56 msec task-clock:u              #    0.846 CPUs utilized      
      ( +-  0.18% )
                 0      context-switches:u        #    0.000 K/sec              
    
                 0      cpu-migrations:u          #    0.000 K/sec              
    
            12,923      page-faults:u             #    0.017 M/sec              
      ( +-  0.01% )
     2,973,502,618      cycles:u                  #    3.951 GHz                
      ( +-  0.05% )
     1,368,004,926      stalled-cycles-frontend:u #   46.01% frontend cycles 
idle     ( +-  0.11% )
       974,077,949      stalled-cycles-backend:u  #   32.76% backend cycles 
idle      ( +-  0.13% )
     4,865,128,800      instructions:u            #    1.64  insn per cycle     
    
                                                  #    0.28  stalled cycles per 
insn  ( +-  0.00% )
     1,035,577,546      branches:u                # 1376.070 M/sec              
      ( +-  0.00% )
        17,721,035      branch-misses:u           #    1.71% of all branches    
      ( +-  0.17% )
     1,206,420,627      L1-dcache-loads:u         # 1603.086 M/sec              
      ( +-  0.00% )
        42,129,928      L1-dcache-load-misses:u   #    3.49% of all L1-dcache 
hits    ( +-  0.04% )
         9,033,444      LLC-loads:u               #   12.004 M/sec              
      ( +-  0.40% )
   <not supported>      LLC-load-misses:u                                       
    

           0.88928 +- 0.00161 seconds time elapsed  ( +-  0.18% )


Attachment: hot-cold.diff
Description: hot/cold v2


reply via email to

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