From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3861 invoked by alias); 5 Mar 2018 02:20:45 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42423 Received: (qmail 3598 invoked by uid 1010); 5 Mar 2018 02:20:45 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(37.59.109.123):SA:0(-1.9/5.0):. Processed in 1.998573 secs); 05 Mar 2018 02:20:45 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Subject: Re: [PATCH] use .zwc files with identical timestamps From: Martijn Dekker To: Zsh hackers list References: <42ad6851-3c3a-f48b-0742-83df943ce814@inlv.org> Message-ID: <37c4799b-f7d8-87b3-fca1-48ce3916b779@inlv.org> Date: Mon, 5 Mar 2018 01:54:42 +0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <42ad6851-3c3a-f48b-0742-83df943ce814@inlv.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Op 14-02-18 om 06:11 schreef Martijn Dekker: > I have been experimenting with zcompile to speed up loading sourced > library scripts. I found that .zwc files are not used if their timestamp > is identical to that of the source file. This can occur, for example, if > an installer script installs a script file and zcompiles it immediately > after. The granularity of file system timestamps, at least on my system, > is not sufficient to register a difference. > > I think it should be a safe enough assumption that they correspond if > the timestamps are identical. The attached patch allows zsh to use .zwc > files if their timestamp is greater than, or identical to the source > file's timestamp. Any opinions on this? Note that this might also fix the issue reported in zsh-workers/41396: | I extract functions from .plugin.zsh files, then compile them as | digest: zcompile -Uz lexicon.zwc functions/* If that compilation is done immediately after the extraction, then in most cases the .zwc files would never actually be used as they'd have timestamps identical to those of the source files. - M.