Benchmark box.execute()
using SELECT 1
queries to verify #4231 implementations.
Clone tarantool into three directories: tarantool-a, tarantool-b, tarantool-c.
Tarantool 2.5.0-16-g9f2819785.
The same as previous, but with Maria's patches from eljashm/gh-4231-box.execute-immutable-function upward (9383e5683c4df9bc9d3b04a2c0bf945b9dcb3bc1 and e2648197b0bb580a1d06033e5dff853b6b4a4569).
The same as previous, but with caching of the value in Lua:
diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index 3ab43b000..de70c5c63 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -556,8 +556,18 @@ setmetatable(box, {
end
})
+local box_is_configured_cached = false
local function box_is_configured()
- return ffi.C.box_is_configured()
+ -- Using of cached Lua value is faster then ffi call.
+ if box_is_configured_cached then
+ return true
+ end
+
+ local res = ffi.C.box_is_configured()
+ if res == true then
+ box_is_configured_cached = true
+ end
+ return res
end
local function load_cfg(cfg)
$ cd tarantool-a
$ cmake . \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DENABLE_BACKTRACE=ON \
-DENABLE_DIST=ON \
-DENABLE_BUNDLED_LIBCURL=OFF \
-DENABLE_WERROR=ON \
&& make -j
$ ./run.sh
Results will be saved into result_*.txt
files.
Then figures can be plotted:
$ ./gen_csv.sh
$ gnuplot plot_avg.txt
$ gnuplot plot.txt