[Freeswitch-users] [Freeswitch-dev] Seeking collaborators for FreeSWITCH/Lua scripting toolkit

Chad Phillips chad at apartmentlines.com
Tue Jan 26 01:20:29 MSK 2016


Stanislav,

Back when I originally wrote Jester, we did some basic load testing of the
Comdian Mail replica profile against Asterisk's actual Comedian Mail (which
is written in C), and the Jester implementation outperformed it.

I think you may be overestimating strain of loading Jester once per call.
Not counting comments, the core module is less than 800 lines of code
(hardly 'huge'), the other modules are all smaller than that, and they can
be loaded conditionally based upon what you want to accomplish. And for
those looking to squeeze more performance out, there's a supplied script to
pre-compile core and all modules, which means they wouldn't have to be
re-compiled every time they're loaded.

I'm clear that there would be more efficient approaches than writing a Lua
toolkit, and, I doubt that most of them would be as easily accessible as
something written in Lua. Given that Lua is already blazing fast for a
scripting language, I think it's a fair compromise.

I will add that I've considered rewriting the core functionality in C for a
number of reasons, performance being one of them, but at this time have
neither the skill nor the time to learn the skill of writing C code at that
level. Someday, maybe... :)

Chad

On Sun, Jan 24, 2016 at 10:54 PM, Stanislav Sinyagin <ssinyagin at gmail.com>
wrote:

> Yes, for relatively small scripts that are concentrated on their jobs. But
> this thing is huge.
> On 25 Jan 2016 3:36 am, "Michael Jerris" <mike at jerris.com> wrote:
>
>> Lua is likely to be by far the most efficient of any scripting language
>> used in FreeSWITCH, if there is still really a concern about performance,
>> more pieces can be moved to helpers built out in c code.  If you are
>> looking for dynamic but still optimal performance, lua is likely your best
>> bet
>>
>> On Sunday, January 24, 2016, Stanislav Sinyagin <ssinyagin at gmail.com>
>> wrote:
>>
>>> why not re-implementing it in Golang and ESL?
>>>
>>> What's happening now with your system, is that FreeSWITCH loads few
>>> thousand lines of Lua code on every call establishment. So, even with
>>> default 30cps limit, you may overload the CPU with unnecessary job.
>>>
>>> if you don't like Go, it could be some other language, but I like the
>>> built-in threads in it.
>>>
>>>
>>>
>>> On Sun, Jan 24, 2016 at 9:47 PM, Chad Phillips <chad at apartmentlines.com>
>>> wrote:
>>> > Hi Bote,
>>> >
>>> > The difference is (supposed to be) that using Jester takes a lot of the
>>> > dirty work out of doing things that you must turn to scripting for. The
>>> > original design was to remove almost all scripting complexity, and
>>> instead
>>> > have users use a more template-based approach to writing their advanced
>>> > workflows. You can have a look at
>>> >
>>> http://thehunmonkgroup.github.io/jester/doc/topics/03-Sequences.md.html#Writing_sequences
>>> > to see the basic template style.
>>> >
>>> > And here's an example template that does some fairly advanced stuff:
>>> >
>>> >
>>> http://thehunmonkgroup.github.io/jester/doc/examples/phone_to_post_test.lua.html
>>> >
>>> > To my eyes, what the template accomplishes is quite easy to deduce from
>>> > simply reading it, and all of the dirty work for taking those actions
>>> is
>>> > handled by Jester core and the supporting modules.
>>> >
>>> > The current limitation is that you must use the template structure to
>>> gain
>>> > access to Jester's modules. Looking back, this was a design mistake
>>> that I
>>> > intend to rectify -- it would be much more powerful and flexible to
>>> use a
>>> > template when it made sense, and still be able to mix pure Lua
>>> scripting
>>> > with calls to Jester's support modules when that makes more sense. And
>>> what
>>> > I'm hoping to get help with is correcting that design flaw while
>>> preserving
>>> > 'the good stuff' in the toolkit.
>>> >
>>> > Chad
>>> >
>>> > On Fri, Jan 22, 2016 at 2:16 PM, Bote Man <bote_radio at botecomm.com>
>>> wrote:
>>> >>
>>> >> Hey Chad, long time no chat J  I saw your update to the Help section
>>> of
>>> >> the Confluence page concerning this and glanced at some things there.
>>> >>
>>> >>
>>> >>
>>> >> I guess I don’t even know enough to understand the difference between
>>> >> using your toolkit and just plain writing a Lua script. Would I, for
>>> >> example, write an abbreviated Lua script that calls tested and proven
>>> >> functions in your toolkit, sort of like a library?
>>> >>
>>> >>
>>> >>
>>> >> Anyway it sounds useful, so thanks.
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> ---
>>> >>
>>> >> Bote
>>> >>
>>> >>
>>> >>
>>> >> FreeSWITCH Docs Janitor
>>> >>
>>> >> http://freeswitch.org/confluence
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> From: Chad Phillips
>>> >> Sent: Friday, 22 January, 2016 14:41
>>> >> Subject: [Freeswitch-users] Seeking collaborators for FreeSWITCH/Lua
>>> >> scripting toolkit
>>> >>
>>> >>
>>> >>
>>> >> Looking for folks in the FreeSWITCH community who would be interested
>>> in
>>> >> collaborating on an open source scripting toolkit I've written for
>>> >> FreeSWITCH/Lua. The basic idea is to have ready made solutions to
>>> common
>>> >> scripting needs, so as not to reinvent the wheel.
>>> >>
>>> >>
>>> >>
>>> >> The original project was written in 2010. A lot of it still works
>>> great,
>>> >> and there are some design flaws that I'd like to work out in the next
>>> >> release.
>>> >>
>>> >>
>>> >>
>>> >> Project code is here: https://github.com/thehunmonkgroup/jester
>>> >>
>>> >>
>>> >>
>>> >> Some background and reasoning for the project here:
>>> >>
>>> http://xylil.com/2016/01/20/jester-freeswitch-lua-and-my-quest-for-an-awesome-scripting-toolkit/
>>> >>
>>> >>
>>> >>
>>> >> If anyone is interested in helping, please let me know!
>>> >>
>>> >>
>>> >>
>>> >> Chad
>>> >>
>>> >>
>>> >>
>>> _________________________________________________________________________
>>> >> Professional FreeSWITCH Consulting Services:
>>> >> consulting at freeswitch.org
>>> >> http://www.freeswitchsolutions.com
>>> >>
>>> >> Official FreeSWITCH Sites
>>> >> http://www.freeswitch.org
>>> >> http://confluence.freeswitch.org
>>> >> http://www.cluecon.com
>>> >>
>>> >> FreeSWITCH-users mailing list
>>> >> FreeSWITCH-users at lists.freeswitch.org
>>> >> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> >> UNSUBSCRIBE:
>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> >> http://www.freeswitch.org
>>> >
>>> >
>>> >
>>> >
>>> _________________________________________________________________________
>>> > Professional FreeSWITCH Consulting Services:
>>> > consulting at freeswitch.org
>>> > http://www.freeswitchsolutions.com
>>> >
>>> > Official FreeSWITCH Sites
>>> > http://www.freeswitch.org
>>> > http://confluence.freeswitch.org
>>> > http://www.cluecon.com
>>> >
>>> > FreeSWITCH-users mailing list
>>> > FreeSWITCH-users at lists.freeswitch.org
>>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> > UNSUBSCRIBE:
>>> http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> > http://www.freeswitch.org
>>>
>>> _________________________________________________________________________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20160125/078f49b4/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list