title: LuaJIT 2 optimization guide
body: <p>I'm looking for a good guide on how to optimize Lua code for <a href="http://luajit.org" rel="noreferrer">LuaJIT 2</a>. It should focus on LJ2 specifics, like how to detect which traces are being compiled and which are not, etc.</p>
  
  <p>Any pointers? Collection of links to Lua ML posts would do as an answer (bonus points for summarizing these links here.)</p>
  
  <p><em>Update: I've changed the title text from 'profiling' to 'optimization' guide, as this makes more sense.</em></p>