From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92339 invoked by alias); 18 May 2017 13:17:06 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 92306 invoked by uid 89); 18 May 2017 13:17:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=boris, surprisingly X-HELO: codesynthesis.com Received: from codesynthesis.com (HELO codesynthesis.com) (70.85.31.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 May 2017 13:17:03 +0000 Received: from brak.codesynthesis.com ([169.255.34.149]) (authenticated bits=0) by codesynthesis.com (8.14.4/8.14.4/Debian-4) with ESMTP id v4IDGuJF016099 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 18 May 2017 09:17:03 -0400 Received: by brak.codesynthesis.com (Postfix, from userid 1000) id BE9181A800E4; Thu, 18 May 2017 15:16:55 +0200 (SAST) Date: Thu, 18 May 2017 13:17:00 -0000 From: Boris Kolpackov To: gcc@gcc.gnu.org Subject: Separate preprocess and compile: some performance numbers Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-SW-Source: 2017-05/txt/msg00185.txt.bz2 Hi, I have implemented the separate preprocess and compile setup in build2. For GCC it is using -fdirectives-only (thanks to everyone's suggestions in the earlier thread). I've also done some benchmarking: https://build2.org/article/preprocess-compile-performance.xhtml TL;DR for GCC: Surprisingly, a separate preprocessor run is about 1% faster (probably because of the time-localization of filesystem access). Overall, a preprocessor run costs about 5% of a non-optimized C++ build. Boris