bug-gnulib
[Top][All Lists]
Advanced

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

Add new macro gl_WARN_ADD_MULTIPLE


From: Alex Gramiak
Subject: Add new macro gl_WARN_ADD_MULTIPLE
Date: Wed, 01 May 2019 17:00:24 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

GNU Emacs spends about ~6s out of ~28s in its configuration process to
determine supported C compiler warnings. The attached patch introduces a
new macro, gl_WARN_ADD_MULTIPLE, that brings this down to about half a
second. This macro first checks if all the supplied warnings are
supported, and then only checks them individually (via gl_WARN_ADD) if
that check fails.

I have also attached sample files configure-prev.ac and configure-new.ac
that were extracted from Emacs's configure.ac for testing. I created a
new directory, copied m4/warnings.m4 and m4/manywarnings.m4 to a new m4
subdirectory, and ran:

  autoconf -f <sample file>

then benchmarked using:

  perf stat -r 20 ./configure

Results of configure-prev.ac:

 Performance counter stats for './configure' (20 runs):

          6,285.79 msec task-clock:u              
                 0      context-switches:u        
                 0      cpu-migrations:u          
           918,039      page-faults:u             
    11,101,658,357      cycles:u                  
    12,777,542,067      stalled-cycles-frontend:u 
    11,234,412,307      stalled-cycles-backend:u  
    14,261,222,341      instructions:u            
                                                  
     2,906,440,712      branches:u                
       100,574,333      branch-misses:u           

           6.34363 +- 0.00614 seconds time elapsed  ( +-  0.10% )


Results of configure-new.ac:

 Performance counter stats for './configure' (20 runs):

            530.29 msec task-clock:u              
                 0      context-switches:u        
                 0      cpu-migrations:u          
            72,010      page-faults:u             
       901,496,456      cycles:u                  
     1,066,313,480      stalled-cycles-frontend:u 
       949,724,068      stalled-cycles-backend:u  
     1,240,144,586      instructions:u            
                                                  
       254,307,360      branches:u                
         7,217,416      branch-misses:u           

           0.53320 +- 0.00210 seconds time elapsed  ( +-  0.39% )

Results of configure-new.ac with a forced fallback (I added a
nonexistent warning to ws):

 Performance counter stats for './configure' (20 runs):

          5,992.42 msec task-clock:u              
                 0      context-switches:u        
                 0      cpu-migrations:u          
           935,599      page-faults:u             
    11,197,607,809      cycles:u                  
    12,982,878,617      stalled-cycles-frontend:u 
    11,427,814,210      stalled-cycles-backend:u  
    14,333,736,238      instructions:u            
                                                  
     2,918,880,583      branches:u                
       100,570,882      branch-misses:u           

            6.0497 +- 0.0468 seconds time elapsed  ( +-  0.77% )

Attachment: 0001-warnings-Add-new-macro-gl_WARN_ADD_MULTIPLE.patch
Description: gl_WARN_ADD_MULTIPLE

Attachment: configure-prev.ac
Description: gl_WARN_ADD

Attachment: configure-new.ac
Description: gl_WARN_ADD_MULTIPLE


reply via email to

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