Skip to content

Universal variables re-narrow path again and again and again #5905

@faho

Description

@faho

In something like

for i in (seq 1000)
    command true
end

about 20% of the total time is taken up in wcs2string, much of that coming from universal_barrier() (which is triggered here because it's an external command - this does not happen with builtin true).

And that does wcs2string because it is narrowing the uvar path, again and again and again, even though it stays the same 99.999% of the time.

I propose we cache the narrow versions of these kinds of paths - we still need the wide version for output. Unfortunately this means changing from our nice and friendly "waccess" et al wrappers, because they do the narrowing for you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePurely performance-related enhancement without any changes in black box output

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions