On 3/15/07, Tassilo Horn <[EMAIL PROTECTED]> wrote:
> "Axel Liljencrantz"
> <[EMAIL PROTECTED]> writes:
>
> Hi Axel,
>
> >> To gather this completions it takes about 25 seconds in which
> >> grepping the whatis database (apropos) and awk utilize the cpu for
> >> nearly 100%. I guess that's partly due to my rather huge whatis
> >> database (1.5 MB), which is Tcl/Tk's fault, but `apropos em' is much
> >> faster (~8 seconds) when executed on console.
> >>
> >> The algorithm for finding command descriptions runs `apropos em'
> >> several times, which is a bad idea and shouldn't be needed. It would
> >> be nice if it could be optimized so that finding descriptions is
> >> reasonable fast.
> >
> > It should only run once.
>
> I tried to monitor the processes (grep, apropos, awk) with htop, and
> they change PIDs about 18 times. So /usr/share/man/whatis is grepped at
> least 18 times -- no wonder that it takes that long.

Ha! Very interesting. I can reproduce this behaviour. It is obviously
wrong. This should take down the completion time to a still completely
unacceptable 5 seconds on your system.

>
> > How long does '__fish_describe_command em' take?
>
> That takes about 5 seconds.

The only way to work around this in a good way is to abort the
description lookup if it takes too much time. Probably something like
0.5 seconds. That is a bit complex to implement, so it'll take some
work. But I think it's the right thing to do in the long run.

For now, you can work around this bug using the following commands:

function __fish_describe_command
end
save_function __fish_describe_command

>
> > Right. 25 seconds to get completions makes them useless. Even
> > non-experienced users are better of getting completions without
> > descriptions in under a second.
>
> Yep.
>
> >> Another weird thing is that emacs is shown two times in the
> >> completion list. `$ e<TAB>' which omitts the descriptions lists it
> >> only once.
> >
> > Very strange indeed. I'll recheck the duplicate removal code.
>
> Ok.
>
> Bye,
> Tassilo
> --
> A child of five could understand this! Fetch me a child of five!
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Fish-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fish-users
>


-- 
Axel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to