zsh-workers
 help / color / mirror / code / Atom feed
* Question about ingetc() vs. word-code
@ 2017-07-05 11:37 Sebastian Gniazdowski
  2017-07-08 21:42 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2017-07-05 11:37 UTC (permalink / raw)
  To: zsh-workers

Hello,
I noticed quite large number of ingetc() calls:

10,588,088  Src/input.c:ingetc [Src/zsh]

This is for:
- zplugin.zsh compiled
- all plugins compiled
- all functions in zwc, loaded via autoload -w

For zplugin uncompiled, it's:

15,315,810  Src/input.c:ingetc [Src/zsh]

So indeed compilation helps. However, when I did:


ingetc(void)
{
    int lastc = ' ';

    if (lexstop)
        return ' ';

    FILE *f = fopen("/tmp/reply", "a+");
    int loop = 0;

    for (;;) {
        if (f) {
            fprintf( f, "%c\n", inbufptr ? *inbufptr : 'x' );
            fflush( f );
        }


then I could find in the output:

xsource"$HHOME/.zplugin/bin/zplugin.zsh"BIN_DIR]BIN_DIR]BIN_DIR]ZERO]ZERO]BIN_DIR]ZERO]BIN_DIR]BIN_DIR]BIN_DIR]BIN_
DIR]HOME_DIR]HOME_DIR]HOME_DIR]PLUGINS_DIR]HOME_DIR]PLUGINS_DIR]PLUGINS_DIR]COMPLETIONS_DIR]HOME_DIR]COMPLETIONS_DI
R]COMPLETIONS_DIR]SNIPPETS_DIR]HOME_DIR]SNIPPETS_DIR]SNIPPETS_DIR]LEX_DIR]HOME_DIR]LEX_DIR]LEX_DIR]


This source command is fine, it comes from uncompiled ~/.zshrc. However, BIN_DIR, ZERO, HOME_DIR, PLUGINS_DIR, SNIPPETS_DIR, LEX_DIR – these ZPLGM hash fields are declared in the beginning of (compiled) zplugin.zsh.

Or following:

CUR_USPL2]*^@keyword]rst]*^@$uuspl2]$uuspl2]$uuspl2^@DTRACE]CUR_USPL2]*^@keyword]rst]*^@$uuspl2]$uuspl2]$uuspl2^@DTRACE]CUR_USPL2]*^@keyword]rst]*^@$uuspl2]$uuspl2]$uuspl2^@

ZPLGM[CUR_USPL2] – zplugin hash field. $uspl2 - local variable. ZPLGM[DTRACE] - hash field.


Why the compiled, not-eval source still exist in hunks in ingetc() input? Many times. The eval-code also appears, but this is probably expected.

--  
Sebastian Gniazdowski
psprint /at/ zdharma.org


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-09  7:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-05 11:37 Question about ingetc() vs. word-code Sebastian Gniazdowski
2017-07-08 21:42 ` Bart Schaefer
2017-07-09  7:25   ` Sebastian Gniazdowski

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).