Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable luajit on the docker image #10414

Merged
merged 1 commit into from Sep 26, 2020
Merged

enable luajit on the docker image #10414

merged 1 commit into from Sep 26, 2020

Conversation

BuckarooBanzay
Copy link
Contributor

@BuckarooBanzay BuckarooBanzay commented Sep 21, 2020

Overview

This PR adds luajit to the "stock" minetest docker image.

It will allow faster lua execution through the luajit library.

There are 2 stages in the Dockerfile: build and package.
In the build stage the luajit-dev package is pulled in with all the libraries and headers.
In the package stage only the luajit package with the previously linked libraries is included.
The size-increase is around 800 kb.

Stats

In my tests i had a 20x to 30x decrease in processing time for lua mapgens with jit enabled.

State

This PR is Ready for Review.

How to test

# buid the image locally
docker build . -t minetest-jit

# start the server part with the new image
docker run --rm -it --network host minetest-jit

# connect with a client to 127.0.0.1:30000
# everything should work as before (or faster)

@paramat paramat added the @ Build CMake, build scripts, official builds, compiler and linker errors label Sep 21, 2020
@paramat
Copy link
Contributor

paramat commented Sep 21, 2020

It will allow faster lua execution through the luajit library.

In my tests i had a 20x to 30x decrease in processing time for lua mapgens with jit enabled.

I am confused, we can already use LuaJIT so why is the increase in Lua speed stated as a benefit of this PR?
The presentation of the PR seems to imply LuaJIT is forced to operate at all times, LuaJIT must remain optional.
Some of the more intensive Lua mapgens and Lua mods are incompatible with LuaJIT because it causes OOM crashes.

@sfan5
Copy link
Member

sfan5 commented Sep 21, 2020

This is solely for the docker image we provide (see here), it doesn't change anything about the build process or what is/isn't required.

@nerzhul
Copy link
Member

nerzhul commented Sep 23, 2020

Are you sure we use it on build ? you just install package, we don't have options to pass to cmake ?

@BuckarooBanzay
Copy link
Contributor Author

Are you sure we use it on build ? you just install package, we don't have options to pass to cmake ?

It's auto-detected:

Step 21/30 : RUN mkdir build && 	cd build && 	cmake .. 		-DCMAKE_INSTALL_PREFIX=/usr/local 		-DCMAKE_BUILD_TYPE=Release 		-DBUILD_SERVER=TRUE 		-DENABLE_PROMETHEUS=TRUE 		-DBUILD_UNITTESTS=FALSE 	-DBUILD_CLIENT=FALSE && 	make -j2 && 	make install
 ---> Running in fdeb2f66a395
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- *** Will build version 5.4.0-dev ***
-- Found Irrlicht: /usr/lib/libIrrlicht.so  
-- Using GMP provided by system.
-- Found GMP: /usr/lib/libgmp.so  
-- Using bundled JSONCPP library.
-- Found LuaJIT: /usr/lib/libluajit-5.1.so (found version "") 
-- Using LuaJIT provided by system.

@HybridDog
Copy link
Contributor

HybridDog commented Sep 24, 2020

As far as I know, there are bugfixes in the latest luajit which are not included in the latest stable release, for example: LuaJIT/LuaJIT@45a7e50
Does it install the latest LuaJIT or the relatively old LuaJIT 2.1.0-beta3 from 2017?

@BuckarooBanzay
Copy link
Contributor Author

As far as I know, there are bugfixes in the latest luajit which are not included in the latest stable release, for example: LuaJIT/LuaJIT@45a7e50
Does it install the latest LuaJIT or the relatively old LuaJIT 2.1.0-beta3 from 2017?

It installs 2.1.0_beta3-r6

Copy link
Member

@SmallJoker SmallJoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@ Build CMake, build scripts, official builds, compiler and linker errors >= Two approvals ✅ ✅
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants