Skip to content

Commit

Permalink
Enable LuaJIT to improve the performance of scripts (#1241)
Browse files Browse the repository at this point in the history
* feat: def use luajit

* ci: update ci

* docs: update readme for luajit

* ci: rename with_luajit to without_luajit

* Update README.md

Co-authored-by: Twice <twice@apache.org>

---------

Co-authored-by: hulk <hulk.website@gmail.com>
Co-authored-by: Twice <twice@apache.org>
  • Loading branch information
3 people authored Feb 2, 2023
1 parent e3465f8 commit 676812d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/kvrocks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,22 @@ jobs:
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC with luaJIT
- name: Ubuntu GCC without luaJIT
os: ubuntu-20.04
with_openssl: -DENABLE_OPENSSL=ON
with_luajit: -DUSE_LUAJIT=ON
without_luajit: -DUSE_LUAJIT=OFF
compiler: gcc
- name: Ubuntu GCC ASan with luaJIT
- name: Ubuntu GCC ASan without luaJIT
os: ubuntu-20.04
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_luajit: -DUSE_LUAJIT=ON
without_luajit: -DUSE_LUAJIT=OFF
with_sanitizer: -DENABLE_ASAN=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
- name: Ubuntu GCC TSan with luaJIT
- name: Ubuntu GCC TSan without luaJIT
os: ubuntu-20.04
without_jemalloc: -DDISABLE_JEMALLOC=ON
with_luajit: -DUSE_LUAJIT=ON
without_luajit: -DUSE_LUAJIT=OFF
with_sanitizer: -DENABLE_TSAN=ON
with_openssl: -DENABLE_OPENSSL=ON
compiler: gcc
Expand Down Expand Up @@ -194,9 +194,9 @@ jobs:

- name: Build Kvrocks
run: |
./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} ${{ matrix.with_luajit }} \
./x.py build -j$NPROC --unittest --compiler ${{ matrix.compiler }} ${{ matrix.without_jemalloc }} ${{ matrix.without_luajit }} \
${{ matrix.with_ninja }} ${{ matrix.with_sanitizer }} ${{ matrix.with_openssl }} ${{ env.CMAKE_EXTRA_DEFS }}
- name: Setup Coredump
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
GOCASE_RUN_ARGS="-tlsEnable"
fi
./x.py test go build $GOCASE_RUN_ARGS
- name: Find reports and crashes
if: always()
run: |
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ option(ENABLE_ASAN "enable address santinizer" OFF)
option(ENABLE_TSAN "enable thread santinizer" OFF)
option(ASAN_WITH_LSAN "enable leak santinizer while address santinizer is enabled" ON)
option(ENABLE_STATIC_LIBSTDCXX "link kvrocks with static library of libstd++ instead of shared library" ON)
option(USE_LUAJIT "use luaJIT instead of lua" OFF)
option(USE_LUAJIT "use luaJIT instead of lua" ON)
option(ENABLE_OPENSSL "enable openssl to support tls connection" OFF)
option(ENABLE_IPO "enable interprocedural optimization" ON)
option(ENABLE_UNWIND "enable libunwind in glog" ON)
Expand All @@ -48,7 +48,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
message(FATAL_ERROR "It is expected to build kvrocks with Xcode toolchains 10 or above")
endif()
else()
message(WARNING "The compiler you are currently using is not officially supported,
message(WARNING "The compiler you are currently using is not officially supported,
so you can try switching to GCC>=7 or Clang>=5 if you encounter problems")
endif()

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ To build with TLS support, you'll need OpenSSL development libraries (e.g. libss
$ ./x.py build -DENABLE_OPENSSL=ON
```

To build with luaJIT instead of lua for better performance, run:
To build with lua instead of luaJIT, run:

```shell
$ ./x.py build -DUSE_LUAJIT=ON
$ ./x.py build -DUSE_LUAJIT=OFF
```

### Running Kvrocks
Expand Down

0 comments on commit 676812d

Please sign in to comment.