Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug#468386: zsh-beta: Slow command completion
- X-seq: zsh-workers 24652
- From: Romain Francoise <rfrancoise@xxxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Subject: Re: Bug#468386: zsh-beta: Slow command completion
- Date: Sun, 02 Mar 2008 16:07:32 +0100
- Cc: zsh-workers@xxxxxxxxxx, 468386@xxxxxxxxxxxxxxx
- In-reply-to: <080228095414.ZM15685@xxxxxxxxxxxxxxxxxxxxxx> (Bart Schaefer's message of "Thu, 28 Feb 2008 09:54:14 -0800")
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- Organization: The Debian Project
- References: <87zltldnde.fsf@xxxxxxxxxxxxxxxxxxxxx> <20080228172715.GA12451@xxxxxxxxxxx> <080228095414.ZM15685@xxxxxxxxxxxxxxxxxxxxxx>
Hi Bart,
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> writes:
> The workaround for Romain is probably to enable caching of the output
> by creating a cache-policy style for :completion::complete:-command-::
> context.
Even after enabling the cache it's still unbearably slow on my
machine (_path_commands already defines a cache-policy style).
Each completion takes about two seconds.
oprofile reports the following:
| CPU: Core 2, speed 1600 MHz (estimated)
| Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with
| a unit mask of 0x00 (Unhalted core cycles) count 100000
| samples % symbol name
| 11356 31.2528 ztrdup
| 5635 15.5080 zalloc
| 3244 8.9278 .plt
| 2766 7.6123 setarrvalue
| 1942 5.3446 zhalloc
| 1460 4.0181 arrlen
| 1457 4.0098 freearray
Which suggests that most of the time is spent building the arrays
fed to compadd and/or formatting $descs w/ zformat. AIUI, before
your change for 24570 most of the contents of $commands were being
thrown away, and it's no longer the case.
It matters since the array is quite large, $commands has 3901
elements here, 2805 of which have descriptions:
$ echo $#_command_descriptions
2805
$ stat -c %s ~/.zsh/command-descriptions
145962
$
--
Romain Francoise <rfrancoise@xxxxxxxxxx>
http://people.debian.org/~rfrancoise/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author