Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] use .zwc files with identical timestamps



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.



Messages sorted by: Reverse Date, Date, Thread, Author