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

Question about ingetc() vs. word-code

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:

    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:


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:


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