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

Huge delay for completions when not sorting



I would have expected that the line

zstyle ':completion:*' sort false

speeds things up if there is a huge number of completions.
However, quite the opposite is true.
If the above zstyle is in effect, the completion for the
artificial command "2" defined by the completion file

#compdef 2
local expl
_description a expl a
compadd "$expl[@]" - {1..40000}

takes ages. Inserting e.g. "touch" commands, it can be verified
that the delay happens _after_ the return of the completion function,
i.e. it is _not_ the compadd itself which is slow.

Moreover, without the _description line there is no delay.

If the 40000 is replaced by 10000, the delay "almost" vanishes
on my machine. Maybe the "critical" number is different on
other systems.



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