bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compgen is slow for large numbers of options


From: Richard Neill
Subject: Re: compgen is slow for large numbers of options
Date: Wed, 14 Mar 2012 17:47:25 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19


If I increase the upper number by a factor of 10, to 500000, these times
become, 436 s (yes, really, 7 minutes!) and 0.20 s respectively. This
suggests that the algorithm used by compgen is O(n^2) whereas the
algorithm used by grep is 0(1).

I meant: grep is O(n).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]