[asterisk-dev] slow slow menuselect (and proposal for a fix)

Luigi Rizzo rizzo at icir.org
Sat Dec 15 17:33:46 CST 2007


On Sat, Dec 15, 2007 at 09:19:53PM +0200, Tzafrir Cohen wrote:
> On Sat, Dec 15, 2007 at 10:07:32AM -0800, Luigi Rizzo wrote:
...
> If the scanning is too slow, maybe it could be optimized. One way is to
> replace everything with a perl/python/whatever script. Such a script
> will not execute multiple binaries mutiple tiomes. Currently for every
> file there are several invocations of printf and awk.
> 
> An obvious optimization is to replace all of that with one perl script.
> Given that some people would disapprove of adding an extra dependency on
> perl, here some (g?)awk command to extract the data from all files:
> 
> time awk 'FNR==1 {printf "\n\nFilename: %s\n",FILENAME}; /\/\*\*\* MODULEINFO/,/\*\*\*\// {print};' */*.c  >version2
> 
> real    0m2.047s
> user    0m0.892s
> sys     0m0.044s

this is not too different from the current code:

	> time gmake menuselect-tree
	Generating input for menuselect ...
	1.353u 2.668s 0:03.32 120.7%    96+226k 5+0io 0pf+0w

As long as we run it only 'on demand' it is still faster than
the 'configure' step so there isn't much to optimize here.

> > i know - all of these options to some degree prevent automatic
> > handling of files stuffed into the tree. But otherwise full dependency
> > checking is too expensive to be run every time. Of course we must
> > provide commands to run such checks (./configure, menuselect/makeopts,
> > ...) but the 'common' make targets should limit themselves to handle
> > 'common' situation i.e. changes to individual sources, not addition
> > of removal of entire files and modules.
> 
> It is not so expensive. It is just not optimized right now.

the cost depends on the system - please try it on an nfs-mounted
volume, or try to build asterisk on windows/cygwin (it does build)
and you will see how much slower it is, especially in the ./configure 
and menuselect steps.

cheers
luigi



More information about the asterisk-dev mailing list