windows optimization code

use LuaJIT FFI to replace table.sort with c++ std::sort