Yes; this could potentially be slow. If for example, you had an application that just had straight line code (no loops), and you were running it from the command line a million times you would end up hurting from this approach. Generating LuaJIT bytecode instead of source code would (I think) make this less of an issue.
In this case, the bytecode is what you start with :)
Going straight from a parse tree to Lua could work, but locks you into the possibly slow code-generation approach. Having an intermediate level (high level bytecode, or even an interpreter over the AST) would be more flexible -- you could choose when to switch over the compiled version.