mainAutoconf - Support: sr #110285, Probes for C++11 and C11 are too...

 
 

sr #110285: Probes for C++11 and C11 are too slow

Submitter:  Zack Weinberg <zackw>
Submitted:  Mon 27 Jul 2020 06:24:27 PM UTC
Votes: 5
 
Priority:  * 5 - Unprioritized Severity:  3 - Normal
Status:  Done Privacy:  Public
Assigned to:  zackw Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 24 Sep 2020 02:11:37 PM UTC, comment #3: 

I'm going to mark this as fixed, but please don't hesitate to reopen if AC_PROG_CXX is still too slow for you.

Zack Weinberg <zackw>
Group administrator
Wed 05 Aug 2020 03:37:09 PM UTC, comment #2: 

I just pushed a commit (c16be715) that makes the C++98 and C++11 test programs exercise only language features, not library features.  On my computer, which is quite new, the minimal configure script

    AC_INIT
    AC_PROG_CXX

executes in 4.5 seconds (wall-clock) before this change and 0.5
seconds after.

Please test autoconf master with this change and report whether it fixes the performance problems for you.

(No code from the autoconf macro archive was used.)

Zack Weinberg <zackw>
Group administrator
Thu 30 Jul 2020 01:58:50 PM UTC, comment #1: 

I noticed this as well; here is a link to my gcc's time report from when I tested it: https://github.com/cooljeanius/gcc_bugs/blob/master/autoconf_cxx11_time_report.txt

Eric Gallager <egallager>
Mon 27 Jul 2020 06:24:27 PM UTC, original submission:  

Reported by Peter Eisentraut on the autoconf mailing list:

> ... the additional tests for C11 and C++11 are slow.  This entirely
> eliminates all the performance improvements made elsewhere.  In
> particular, the test
>
> checking for g++ option to enable C++11 features... none needed
>
> takes on the order of 10 seconds for some developers.  And that is for
> one loop, since "none needed"; good luck if you need more than none.


This is because the test probes for C++11 library features, and the C++ standard library is notoriously heavyweight.  The test program used by _AC_PROG_CXX_CXX11 is only about 150 lines long but it expands to 47,000 lines of gnarly template classes after preprocessing, and roughly 30,000 assembly instructions after compilation. With -g enabled (as is the default) 770,000 lines of debug information are also emitted into the assembly.

(By way of comparison, the test program used by _AC_PROG_CXX_CXX98 also expands to 47,000 lines of standard-library template classes after preprocessing, but they're not nearly as gnarly.  The assembly output has only about 2000 lines of actual instructions and 90,000 lines of debug information.)

Both of these tests are new since Autoconf 2.69, so there's no installed base depending on this behavior.  The equivalent macro from the Autoconf Macro Archive, https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=m4/ax_cxx_compile_stdcxx.m4 , only tests for language features; I think it would be reasonable to make our tests do the same.  Unfortunately we can't just uplift that code without first chasing a bunch of copyright assignments.

Zack Weinberg <zackw>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by zackw (Original reporter)
  • -email is unavailable- added by egallager (Posted a comment)
  • -email is unavailable- added by egallager
  • -email is unavailable- added by egallager (Voted in favor of this item)
  • -email is unavailable- added by zackw (Submitted the item)
  •  

    There are 5 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-09-24 zackw StatusReady For Test Done
        Open/ClosedOpen Closed
    2020-08-05 zackw StatusIn Progress Ready For Test
        Carbon-Copy- Added -email is unavailable-
    2020-07-30 egallager Carbon-Copy- Added -email is unavailable-
        Carbon-Copy- Added egallager

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code