* Re: Is this statement correct?
@ 2000-09-07 11:41 Sven Wischnowsky
2000-09-19 5:50 ` Andrej Borsenkow
0 siblings, 1 reply; 5+ messages in thread
From: Sven Wischnowsky @ 2000-09-07 11:41 UTC (permalink / raw)
To: zsh-workers
Andrej Borsenkow wrote:
> This from new section, User contribution/Utilities:
>
> ====
> Recompiling Functions
> ---------------------
>
> If you frequently edit your zsh functions, or periodically update your
> zsh installation to track the latest developments, you may find that
> function digests compiled with the zcompile builtin are frequently out
> of date with respect to the function source files. This is not usually
> a problem, because zsh always looks for the newest file when loading a
> function, but it may cause slower shell startup and function loading.
> ====
>
> I remember, that Sven explicitly stated that digest files are *not* checked
> against there source functions to save execution time (individual files are).
> I do not have articele number handy.
I vaguely remember having said something about this or something
similar but having been confused at that time (I don't remember when
that was either and can't offer a message number). However: yes, it is
true. The code *does* compare the times for digest files, individual
zwc files and the original file (if they can be found). See the
function try_dump_file() in parse.c.
Bye
Sven
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: Is this statement correct?
2000-09-07 11:41 Is this statement correct? Sven Wischnowsky
@ 2000-09-19 5:50 ` Andrej Borsenkow
2000-09-19 7:18 ` Bart Schaefer
0 siblings, 1 reply; 5+ messages in thread
From: Andrej Borsenkow @ 2000-09-19 5:50 UTC (permalink / raw)
To: zsh-workers
>
>
> Andrej Borsenkow wrote:
>
> > This from new section, User contribution/Utilities:
> >
> > ====
> > Recompiling Functions
> > ---------------------
> >
> > If you frequently edit your zsh functions, or periodically update your
> > zsh installation to track the latest developments, you may find that
> > function digests compiled with the zcompile builtin are frequently out
> > of date with respect to the function source files. This is not usually
> > a problem, because zsh always looks for the newest file when loading a
> > function, but it may cause slower shell startup and function loading.
> > ====
> >
> > I remember, that Sven explicitly stated that digest files are
> *not* checked
> > against there source functions to save execution time (individual
> files are).
> > I do not have articele number handy.
>
> I vaguely remember having said something about this or something
> similar but having been confused at that time (I don't remember when
> that was either and can't offer a message number). However: yes, it is
> true. The code *does* compare the times for digest files, individual
> zwc files and the original file (if they can be found). See the
> function try_dump_file() in parse.c.
>
It does not work:
bor@itsrm2% print $fpath
/home/bor/.zsh.d/completion /home/bor/.zsh.d/std-3.1.9-dev-6.zwc
/home/bor/.zsh.d/functions /tools/share/zsh/site-functions ... (standard part
follows)
bor@itsrm2% ll /tools/share/zsh/3.1.9-dev-6/functions/Core/_match
-rw-r--r-- 1 root other 1539 Sep 19 09:44
/tools/share/zsh/3.1.9-dev-6/functions/Core/_match
bor@itsrm2% ll ~/.zsh.d/std-3.1.9-dev-6.zwc
-rw------- 1 bor sinix 1491984 Sep 18 11:08
/home/bor/.zsh.d/std-3.1.9-dev-6.zwc
Zsh takes _match from digest file and *not* from external definition. Even if
it is newer.
-andrej
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is this statement correct?
2000-09-19 5:50 ` Andrej Borsenkow
@ 2000-09-19 7:18 ` Bart Schaefer
2000-09-19 8:00 ` PATCH: " Andrej Borsenkow
0 siblings, 1 reply; 5+ messages in thread
From: Bart Schaefer @ 2000-09-19 7:18 UTC (permalink / raw)
To: Andrej Borsenkow, zsh-workers
On Sep 19, 9:50am, Andrej Borsenkow wrote:
} Subject: RE: Is this statement correct?
}
} > > This is not usually
} > > a problem, because zsh always looks for the newest file when loading a
} > > function, but it may cause slower shell startup and function loading.
}
} It does not work:
}
} bor@itsrm2% print $fpath
} /home/bor/.zsh.d/completion /home/bor/.zsh.d/std-3.1.9-dev-6.zwc
} /home/bor/.zsh.d/functions /tools/share/zsh/site-functions ... (standard
} part follows)
} bor@itsrm2% ll /tools/share/zsh/3.1.9-dev-6/functions/Core/_match
} -rw-r--r-- 1 root other 1539 Sep 19 09:44
} /tools/share/zsh/3.1.9-dev-6/functions/Core/_match
} bor@itsrm2% ll ~/.zsh.d/std-3.1.9-dev-6.zwc
} -rw------- 1 bor sinix 1491984 Sep 18 11:08
} /home/bor/.zsh.d/std-3.1.9-dev-6.zwc
}
} Zsh takes _match from digest file and *not* from external definition.
} Even if it is newer.
The order of $fpath takes precedence over the newness of the files. It
doesn't search for the newest thing anywhere in $fpath; it checks for
the newest one of any two otherwise-equivalent sources of the function.
In particular, zsh does not read the name of the source file out of the
digest file and try to find it. The autoload-time checks are all done
relative to *directories* named in $fpath. If you put a digest name
into $fpath (as you have), then that file is accepted automatically.
If on the other hand you leave directory names in the path and put the
digest file alongside the directory (within that directory's parent),
then zsh will check for the newer of a function in the directory or a
function in the digest file.
So if you have fpath=(/zsh/fdir) and these three files:
/zsh/fdir.zwc /zsh/fdir/func /zsh/fdir/func.zwc
Then zsh will always pick the newest one for the definition of "func".
I suppose the example in contrib.yo is a bit misleading because it
replaces the directory names with digest file names in $fpath. That's
actually not necessary for zrecompile to work.
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
^ permalink raw reply [flat|nested] 5+ messages in thread
* PATCH: RE: Is this statement correct?
2000-09-19 7:18 ` Bart Schaefer
@ 2000-09-19 8:00 ` Andrej Borsenkow
0 siblings, 0 replies; 5+ messages in thread
From: Andrej Borsenkow @ 2000-09-19 8:00 UTC (permalink / raw)
To: Bart Schaefer, zsh-workers
>
> The order of $fpath takes precedence over the newness of the files. It
> doesn't search for the newest thing anywhere in $fpath; it checks for
> the newest one of any two otherwise-equivalent sources of the function.
>
If you agree with my english, I'll commit it to avoid more confusion.
-andrej
Index: Doc/Zsh/contrib.yo
===================================================================
RCS file: /cvsroot/zsh/zsh/Doc/Zsh/contrib.yo,v
retrieving revision 1.6
diff -u -r1.6 contrib.yo
--- Doc/Zsh/contrib.yo 2000/09/15 15:32:25 1.6
+++ Doc/Zsh/contrib.yo 2000/09/19 07:59:18
@@ -81,7 +81,9 @@
digests compiled with the tt(zcompile) builtin are frequently out of date
with respect to the function source files. This is not usually a problem,
because zsh always looks for the newest file when loading a function, but
-it may cause slower shell startup and function loading.
+it may cause slower shell startup and function loading. Also, if digest
+file is explicitly used as element of tt(fpath), zsh won't check if any
+of its source files was changed.
The tt(zrecompile) autoloadable function, found in tt(Functions/Misc), can
be used to keep function digests up to date.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Is this statement correct?
@ 2000-09-07 11:26 Andrej Borsenkow
0 siblings, 0 replies; 5+ messages in thread
From: Andrej Borsenkow @ 2000-09-07 11:26 UTC (permalink / raw)
To: ZSH workers mailing list
This from new section, User contribution/Utilities:
====
Recompiling Functions
---------------------
If you frequently edit your zsh functions, or periodically update your
zsh installation to track the latest developments, you may find that
function digests compiled with the zcompile builtin are frequently out
of date with respect to the function source files. This is not usually
a problem, because zsh always looks for the newest file when loading a
function, but it may cause slower shell startup and function loading.
====
I remember, that Sven explicitly stated that digest files are *not* checked
against there source functions to save execution time (individual files are).
I do not have articele number handy.
-andrej
Have a nice DOS!
B >>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2000-09-19 8:02 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-09-07 11:41 Is this statement correct? Sven Wischnowsky
2000-09-19 5:50 ` Andrej Borsenkow
2000-09-19 7:18 ` Bart Schaefer
2000-09-19 8:00 ` PATCH: " Andrej Borsenkow
-- strict thread matches above, loose matches on Subject: below --
2000-09-07 11:26 Andrej Borsenkow
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).