Commit Graph

22 Commits (32ec7da129ebafbd28d8c19af56131e675fe0a4c)

Author SHA1 Message Date
Steve Murphy c51c46ba7f Merged revisions 111360 via svnmerge from
17 years ago
Steve Murphy 6c23fca72a Merged revisions 109357 via svnmerge from
17 years ago
Steve Murphy 3f152e5ff0 Merged revisions 97889 via svnmerge from
18 years ago
Steve Murphy ab92fc1f35 made AEL 8-bit transparent; mainly the lexer was tossing chars with the hi-order bit set. Not nice. Also, allow @ in extension names, and a backslash, also.
18 years ago
Luigi Rizzo 51391e6b09 shuffle a little bit the content of header files to reduce dependencies.
18 years ago
Steve Murphy a897556f7f This is the perhaps the biggest, boldest, most daring change I've ever committed to trunk. Forgive me in advance any disruption this may cause, and please, report any problems via the bugtracker. The upside is that this can speed up large dialplans by 20 times (or more). Context, extension, and priority matching are all fairly constant-time searches. I introduce here my hashtables (hashtabs), and a regression for them. I would have used the ast_obj2 tables, but mine are resizeable, and don't need the object destruction capability. The hashtab stuff is well tested and stable. I introduce a data structure, a trie, for extension pattern matching, in which knowledge of all patterns is accumulated, and all matches can be found via a single traversal of the tree. This is per-context. The trie is formed on the first lookup attempt, and stored in the context for future lookups. Destruction routines are in place for hashtabs and the pattern match trie. You can see the contents of the pattern match trie by using the 'dialplan show' cli command when 'core set debug' has been done to put it in debug mode. The pattern tree traversal only traverses those parts of the tree that are interesting. It uses a scoreboard sort of approach to find the best match. The speed of the traversal is more a function of the length of the pattern than the number of patterns in the tree. The tree also contains the CID matching patterns. See the source code comments for details on how everything works. I believe the approach general enough that any issues that might come up involving fine points in the pattern matching algorithm, can be solved by just tweaking things. We shall see. The current pattern matcher is fairly involved, and replicating every nuance of it is difficult. If you find and report problems, I will try to resolve than as quickly as I can. The trie and hashtabs are added to the existing context and exten structs, and none of the old machinery has been removed for the sake of the multitude of functions that use them. In the future, we can (maybe) weed out the linked lists and save some space.
18 years ago
Steve Murphy 63f2f04cf4 This commits the performance mods that give the priority processing engine in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc.
18 years ago
Steve Murphy 8c5bf67f4a Merged revisions 87775 via svnmerge from
18 years ago
Steve Murphy c9f3efc381 Merged revisions 87168 via svnmerge from
18 years ago
Steve Murphy b7ef49c931 closes issue #11005, where #include uses the current dir instead of the config dir (/etc/asterisk) for relative path includes for AEL
18 years ago
Steve Murphy d914cbee48 Merged revisions 86936 via svnmerge from
18 years ago
Steve Murphy 3ffa04bbd3 Merged revisions 84511 via svnmerge from
18 years ago
Steve Murphy b3168a76c9 Merged revisions 84239 via svnmerge from
18 years ago
Steve Murphy b0abdf45a6 Merged revisions 84133 via svnmerge from
18 years ago
Kevin P. Fleming 5cbba2923c deal with more gcc 4.2 const pointer warnings
18 years ago
Joshua Colp 20a71bad79 Fix minor memory leak in pval.c. Overwriting a value without freeing the previous result is bad, mmmk?
18 years ago
Steve Murphy 4f013699e2 Merged revisions 83589 via svnmerge from
18 years ago
Steve Murphy f2b38cf2f3 Merged revisions 83558 via svnmerge from
18 years ago
Russell Bryant 9388173f85 Make the MALLOC_DEBUG output for free() useful again. After changing calls to
18 years ago
Steve Murphy 83e28341b5 an unreported crash I debugged, looked like it was backing up way too far after hitting the syntax error. An inspection of the code revealed that error tokens in lists were not rearranged when the rules were rearranged as part of a code neatening-up process. By moving the error tokens to where they should be, I also reduced the number of shift/reduce conflicts to 3 instead of 8. This introduces subtle differences in error messages, so the regressions had to be updated.
18 years ago
Steve Murphy 35ade91df6 As per 10472, mvanbaak thought the generated code would look better this way.
18 years ago
Steve Murphy 9836efb5fb This commit closes bug 7605, and half-closes 7638. The AEL code has been redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files.
18 years ago