03-17-2015, 01:47 AM
03-17-2015, 04:13 AM
I'm especialy curious if Lua generators are faster using LuaJIT, because currently I get around 30-40 ch/s with my FloatingIslands generator. If I'd suddenly get 100 ch/s then that would allow much more complex and advanced to be written in Lua.
03-17-2015, 04:59 AM
If there's alot of looping and number manipuation that goes on in the generator side, I wouldn't be surprised if you got double that. 
So basically, here's what I did:
First, I built the server normally to generate Bindings.cpp and Bindings.h as they refused to generate after the patch.
Then in CMakeLists.txt in the root source folder, I changed it to this:
# Include all the libraries:
add_subdirectory(lib/jsoncpp/)
add_subdirectory(lib/zlib/)
add_subdirectory(lib/tolua++/)
add_subdirectory(lib/sqlite/)
add_subdirectory(lib/SQLiteCpp/)
add_subdirectory(lib/expat/)
add_subdirectory(lib/luaexpat/)
add_subdirectory(lib/libevent/)
(The Lua entry was removed.)
Next I did deleted the lua folder in src/lib/ and lib/lua/
Then I downloaded LuaJIT libs from my Ubuntu repo.
Then, assuming that you ran cmake already, I went into src/src/CMakeFiles/MCServer.dir/link.txt.
There should be 2 flags under there that link to Lua libraries (-llua). I changed these to the file path of the static libs of LuaJIT installed earlier.
Now in src/lib/tolua++/CMakeFiles/tolua.dir/link.txt, do the same thing and replace "-llua" with the abolute filepath of the static LuaJIT lib.
Then go back and run make, it should compile relatively smoothly.

So basically, here's what I did:
First, I built the server normally to generate Bindings.cpp and Bindings.h as they refused to generate after the patch.
Then in CMakeLists.txt in the root source folder, I changed it to this:
# Include all the libraries:
add_subdirectory(lib/jsoncpp/)
add_subdirectory(lib/zlib/)
add_subdirectory(lib/tolua++/)
add_subdirectory(lib/sqlite/)
add_subdirectory(lib/SQLiteCpp/)
add_subdirectory(lib/expat/)
add_subdirectory(lib/luaexpat/)
add_subdirectory(lib/libevent/)
(The Lua entry was removed.)
Next I did deleted the lua folder in src/lib/ and lib/lua/
Then I downloaded LuaJIT libs from my Ubuntu repo.
Then, assuming that you ran cmake already, I went into src/src/CMakeFiles/MCServer.dir/link.txt.
There should be 2 flags under there that link to Lua libraries (-llua). I changed these to the file path of the static libs of LuaJIT installed earlier.
Now in src/lib/tolua++/CMakeFiles/tolua.dir/link.txt, do the same thing and replace "-llua" with the abolute filepath of the static LuaJIT lib.
Then go back and run make, it should compile relatively smoothly.

03-17-2015, 05:22 AM
And I just tried your FloatingIslands generator on my Odroid XU3. I got about 3.5ch/s vanilla and 9-12ch/s JIT. 

03-17-2015, 05:38 AM
That sounds nice.
Also: http://luajit.org/performance_x86.html
Also: http://luajit.org/performance_x86.html
03-17-2015, 05:52 AM
Nice that's around 2.5 times faster ;D Still that is pretty slow, so we might want to do some measurements on a different computer

03-17-2015, 06:17 AM
Tested it on an Intel Core i3-4000U, got 14ch/s vanilla, 22ch/sJIT. 
Also, It seems that when creating Bindings.cpp and Bindings.h, according to this FAQ, something needs to be adjusted:
"attempt to index global 'arg' (a nil value)"
http://luajit.org/faq.html

Also, It seems that when creating Bindings.cpp and Bindings.h, according to this FAQ, something needs to be adjusted:
"attempt to index global 'arg' (a nil value)"
http://luajit.org/faq.html
03-17-2015, 04:49 PM
I'm a bit concerned that there is only an explicit list of supported platforms, it doesn't compile for others (http://luajit.org/faq.html , last-but-one item). This might be a problem, since we do support all the obscure platforms that have a C++11 compiler available.
03-17-2015, 05:45 PM
If this could be added as a compile-time switch, we wouldn't have that problem.
But, i'm don't know how doable is that.
But, i'm don't know how doable is that.
03-18-2015, 06:12 AM
That would be nice. Add the option as a CMake flag or something? 
