From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96233 invoked by alias); 20 Feb 2016 05:48:10 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 96010 invoked by uid 89); 20 Feb 2016 05:47:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*Ad:U*tkoenig, contiguous, jorge, Jorge X-HELO: cc-smtpout2.netcologne.de Received: from cc-smtpout2.netcologne.de (HELO cc-smtpout2.netcologne.de) (89.1.8.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 20 Feb 2016 05:47:55 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout2.netcologne.de (Postfix) with ESMTP id 3935E1254F for ; Sat, 20 Feb 2016 06:47:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 365B411D73 for ; Sat, 20 Feb 2016 06:47:51 +0100 (CET) Received: from [78.35.153.203] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.0.9) (envelope-from ) id 56c7fe07-0b53-7f0000012729-7f000001a5a5-1 for ; Sat, 20 Feb 2016 06:47:51 +0100 Received: from [192.168.178.20] (xdsl-78-35-153-203.netcologne.de [78.35.153.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA for ; Sat, 20 Feb 2016 06:47:50 +0100 (CET) Subject: Re: Can be a subroutine slower when is placed in a module? To: fortran@gcc.gnu.org References: <137342279.2361.1446468932104.JavaMail.zimbra@intec.unl.edu.ar> <1173768206.3389.1455917209410.JavaMail.zimbra@intec.unl.edu.ar> From: Thomas Koenig Message-ID: <56C7FE05.8050506@netcologne.de> Date: Sat, 20 Feb 2016 05:48:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <1173768206.3389.1455917209410.JavaMail.zimbra@intec.unl.edu.ar> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-02/txt/msg00076.txt.bz2 Hi Jorge, > However, the CPU time increased by 170%, more or less, in > the test3 where a module is used. Question: it is expected > behavior, or there's something that I missing? e.g. in the > GFortran compilation flags, or in the coding style used? etc. -- Without having tested the code myself, there are two things that will almost definitely make an improvement: - Link-time optimization (use -flto for this) - setting the "contiguous" attribute on dummy array arguments Regards Thomas