luajit

41 views
Skip to first unread message

Kousuke

unread,
Mar 2, 2021, 4:20:40 AM3/2/21
to meetecho-janus
Hi, guys, I'm newby to janus but it seems a really good product and a community.

I am looking around janus document and codes, and seems we can use lua to make janus plugins. I actually never have any experience around lua, but according to some sites, the luajit is really faster than normal lua(like 64x) https://luajit.org/performance_x86.html .
But in my short experience with janus, I feel current janus is liked with normal lua, not JIT.

So what I would like to ask is, 
- Can we use make lua plugin with luajit?
- Is there any document to link janus with luajit?

Thanks!
- Kousuke

Lorenzo Miniero

unread,
Mar 2, 2021, 5:10:03 AM3/2/21
to meetecho-janus
We've never tried, honestly, as I wasn't aware of it. It may be as simple as changing the configure.ac checks and how we link in Makefile.am, but not sure.
If you experiment with that and get it to work, we'd be happy to review a pull request!

Lorenzo

Kousuke Kikuchi

unread,
Mar 2, 2021, 5:44:51 AM3/2/21
to Lorenzo Miniero, meetecho-janus
Hi, Lorenzo

Thanks for your quick response.

I had have experience around configure, but it's too far, so I did quick hack

changed

$ grep jit Makefile
LUA_CFLAGS = -I/usr/include/luajit-2.1
LUA_LIBS = -lluajit-5.1

and make && make install

$ ldd /opt/janus/lib/janus/plugins/libjanus_lua.so | grep lua
libluajit-5.1.so.2 => /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2
(0x00007f391ad32000)

seems linked with luajit

and run echotest.lua, with
plugin: "janus.plugin.echolua",

I think it is working fine with my quick run :)
I don't know how it is faster, hopefully someone having knowledge with
janus will check and see how good or not lol

Thansk!
- Kousuke

2021年3月2日(火) 2:10 Lorenzo Miniero <lmin...@gmail.com>:
> --
> You received this message because you are subscribed to a topic in the Google Groups "meetecho-janus" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/meetecho-janus/OKTLyL57qM4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to meetecho-janu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/meetecho-janus/1c7664c9-cba2-43dc-a9ca-89b49a74a11dn%40googlegroups.com.

Kousuke Kikuchi

unread,
Mar 2, 2021, 6:01:29 AM3/2/21
to Lorenzo Miniero, meetecho-janus
One more additional info around luajit.

luajit is compatible with lua5.1.
If you don't need 5.2, 5.3 features, lua plugin will become faster a
lot, hopefully.
Some sites said, the speed of luajit is not so far with C, and fastest
in the script language(I didn't test at all though)


2021年3月2日(火) 2:44 Kousuke Kikuchi <kousuke...@gmail.com>:

Lorenzo Miniero

unread,
Mar 2, 2021, 6:08:32 AM3/2/21
to meetecho-janus
I think we require 5.3 right now, but I can't remember if this was for a specific reason. Considering the way we do asynchronous tasks, if 5.1 and 5.3 differ a lot there, the plugin may break with an older version of Lua. Unfortunately I don't know enough about the differences in versions.

L.

Kousuke

unread,
Mar 2, 2021, 2:26:43 PM3/2/21
to meetecho-janus
Thanks.

I googled some and not sure what differences between 5.1 and 5.3 https://www.lua.org/versions.html
echolua is still working for my case after one night run, but not sure if it's by chance.
I feel 5.1 itself is too old because latest release is 2012. Latest luajit which is compatible with lua5.1 was released 2017 and still working on.
Please let us know why you use 5.3 if you remember :)

I changed one line to use luajit(temporary change, but I believe it finds luajit first, and then finds lua5.3)

$ diff configure.ac configure.ac.org 

811c811

<                   [luajit],

---

>                   [lua],


If someone would like to do luajit with janus(faster lua plugin), it is probably worth to try ;)

Thanks!

- Kousuke

2021年3月2日火曜日 3:08:32 UTC-8 lmin...@gmail.com:
Reply all
Reply to author
Forward
0 new messages