I've just spent some time playing with VS Code, which has a couple very nice community written Lua debuggers. However, as Seungjae Lee notes in his
README.md, the performance hit that one sees from using one of these debuggers is reduced dramatically if one registers breakpoints using Dan Tull's
OP_HALT patch in place of debug.sethook().
I don't fully understand the reasons /why/ OP_HALT is so useful, but, I can confirm that, in my own use case at least, implementing OP_HALT changes the overhead from running with a debugger from 'severe' to 'unnoticeable'.
Unfortunately, Dan's original patch is now 7+ years old, and
Seungjae Lee's 5.1.5 version is written against a version of the codebase that's only slightly newer. I have managed to apply
Seungjae Lee's version of
OP_HALT to my own modded copy of Lua 5.2, and it appears to work well.