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

Question about ingetc() vs. word-code



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



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