[asterisk-dev] fast-ast2 ready to merge to trunk, is that OK?

Steve Murphy murf at digium.com
Mon Nov 5 18:40:57 CST 2007

On Mon, 2007-11-05 at 17:35 -0600, Matthew Nicholson wrote:
> On Mon, 2007-11-05 at 22:15 +0200, Victor Sergeev wrote:
> > Steve Murphy wrote:
> > >
> > > 1. Flat response times in searching for a matching context, exten, and
> > > priority in the dialplan, which were previously subject to exponential
> > > slowdowns due to linked list searches. I have made graphs from 1 to 1000
> > > elements in each category. This means that in a dialplan with 1000
> > > contexts, and the context we are executing in, has 1000 extensions, and
> > > in that context, we are executing apps after the 1000th priority, we
> > > will see a speedup over the old code of roughly 23x. For bigger
> > > dialplans, the speedup will be greater.  For dialplans with
> > > over 10,000 extensions, the speedup could be maybe 100x; I haven't
> > > measured it yet.
> > >
> > >   
> > It'll be interesting to compare it with the same kind of dial plan
> > written in recently introduced LUA.
> > Could you include such  comparison in your future benchmarks.
> Steve,
> If you need help generating the required diaplan code in lua, I am
> willing to assist you.


Many thanks! All you have to do is write a small loop to call
a million times. It needs to record the beginning time, and ending time,
and report the total time to completion. Uh, to make things even, use a
var with a million in it, instead of the straight constant. And a var to
hold the loop count, of course.

Should run rings around AEL... ahem.

Actually, unless lua is embedded within Asterisk, it might not win;
especially if it has to any socket communications... but if it's
executing directly in an asterisk thread, AEL might not have a chance.

Haven't had time to benchmark AGI scripts....

If you are going to totally replicate the tests, you'll need to
the full dialplans... I have a set of 25 dialplans: 8 with varying
of contexts (1,10,50,100,200,300,500,1000), each having one extension,
and one priority, except the test extension, which has the million loop
in it.

The next set of 8 contain one context with a varying number of
extensions in it.
(1,10,50,100,200,300,500,1000); in the first extension, the million loop
should be located.

The last set of 8 contains one context, and one extension, but a
variable number
of NoOp() calls before the loop. (1,10,50,100,200,300,500,1000),

And, one last dialplan with 1000 contexts, the first having 1000
extensions, the first having 1000 NoOp(Hello There) calls before the
million loop.

If the lua interface uses hashtabs for the contexts/priorities, then
until they 
use the "trie" for the extens, the only set of tests to show a slowdown
should be
the set with varying number of extensions.


Steve Murphy
Software Developer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3227 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20071105/9babe274/attachment-0001.bin 

More information about the asterisk-dev mailing list