A Walk with LuaJIT

83 points - last Tuesday at 7:38 AM

Source
  • brancz

    yesterday at 9:03 PM

    Thanks for submitting! We know HN has a sweet spot for LuaJIT, so we figured it would eventually end up here.

    Quick summary: this post dives into the gory details of how we implemented an eBPF based profiler for LuaJIT.

    Let us know if you have any questions on this, we’ll keep an eye out on comments!

      • neomantra

        yesterday at 9:55 PM

        Very deep dive, thank you for sharing it all. So cool it traverses callbacks too.

          • brancz

            yesterday at 9:59 PM

            Glad you liked it! Yeah, we worked with a customer who really needs this badly and has done some unspeakable things to get by until now.

        • yesterday at 10:49 PM

      • gnurizen

        yesterday at 10:45 PM

        I wrote the code and the blog, happy to answer any questions/comments. Very eager to have folks try it out and give feedback! Like is my meme game strong or very strong? J/K

        There's some missing bits around FFI and callbacks (i.e. C calling function pointer that is a luajit generated stub back into the interpreter) and curious if anyone actually uses these things in OpenResty workloads. Deploy and enjoy!

        • alberth

          yesterday at 9:06 PM

          I’m tremendous excited about LuaJIT 3.0 development.

          https://github.com/LuaJIT/LuaJIT/issues/1092

          Q: does anyone know timeline on the release?

            • rurban

              yesterday at 9:36 PM

              Looks like 10 years to me

                • slekker

                  yesterday at 10:10 PM

                  Why do you think that?

                    • dkersten

                      yesterday at 11:01 PM

                      None of the items listed there have been ticked off in the time since the ticket was opened, not even the “create v3 branch” one. Mike also has had plans for v3 for at least the last decade too.

                      So, I’m sure it’ll get worked on when he can, and it’ll be great when it’s done, but it doesn’t look like there’s active development on it and it doesn’t look like it will happen any time soon. I hope in wrong, of course, but it just doesn’t seem likely.

        • benwilber0

          yesterday at 11:30 PM

          LuaJIT.org stopped publishing release tarballs [1] which caused leafo's GH actions builds [2] to suddenly stop working. The workaround was to start testing against OpenResty's distribution of LuaJIT [3] which is incompatible with LuaJIT.org's version.

          There is no faster way to make a fork the de facto standard version than to break everyone's CI builds.

          [1] https://luajit.org/download.html

          [2] https://github.com/leafo/gh-actions-lua/issues/49

          [3] https://github.com/openresty/luajit2

            • krapp

              yesterday at 11:50 PM

              The workaround for LuaJIT moving to Github was to... clone a fork of it?

              If they could do that, why can't they just pull from the LuaJIT repo?

                • tecleandor

                  today at 1:04 AM

                  LuaJIT didn't move to GitHub, they just have a mirror there.

                  The thing is they stopped numbering and publishing releases, it's all a rolling release without any name or number, so you cannot snapshot I'm certain version.

                  But OpenResty fork does create tag versions with date, so they can build or test against certain concrete snapshot frozen in time.

          • dreampeppers99

            today at 12:12 AM

            Lua and Nginx are fantastic. Did you know it's possible to add behavior/code lua for openrest dynamically? https://github.com/leandromoreira/lua-resty-dynacode?tab=rea...