Programming C modules is always* going to be faster than any of the
other languages listed because C is compiled, and the other languages
listed are interpreted -- i.e. a parser needs to be loaded for each
instantiation of the script, which can be very heavy on processor and
memory load.

Java can be faster than C/C++ because what you call "interpreted" is
really "delayed compilation" - Java code is compiled down to native at
runtime. Of course this only works well for long-running apps; as you
suggest, a module that has to start it up each time is going to lose
(but that's true of anything that has significant initialization
overhead!). Running it in FastAGI would solve this problem. What Sun did
on the web tier is build a framework that keeps Java "servlets" in
memory (hence, the compiled code is retained) as long as possible. Java
has done very well in the enterprise market as a result of this.

Using FastAGI() as Duane recommended will probably help a lot in this
regard, but if you have C programming skills, then you might as well
just write modules directly for Asterisk as that will be the least
amount of overhead.

* I'm sure there are some circumstances when C isn't always the
fastest, but 1) I don't program in C, and 2) I can't think of any
situations where that wouldn't be true :)

Anything long running is a possibility. Sun have a benchmark (sorry I
forget the URL) showing Java to be FASTER than C/C++ for numerical
analysis involving heavy looping over matrices and the like.

Oh yes, here's a non-Sun version that shows the same thing for a wider
variety of test cases:

http://java.sys-con.com/read/45250.htm

Ian


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to