Timer calls between C++ and Lua with LuaIntf.
Just a test.
- Lua is fast.
- LuaIntf is good.
- Call from Lua to C++ is faster than from C++ to Lua.
- Install conan.
conan remote add remote_bintray_jinq0123 https://api.bintray.com/conan/jinq0123/testconan install --build missingPROJECT: Generator visual_studio created conanbuildinfo.props PROJECT: Generated conaninfo.txt- Use sln to build. Select Release config.
C++ calls lua add() many times:
2.759473s wall, 2.761218s user + 0.000000s system = 2.761218s CPU (100.1%)
C++ calls lua add_times() once:
0.436400s wall, 0.436803s user + 0.000000s system = 0.436803s CPU (100.1%)
Lua calls C++ add() many times:
0.535802s wall, 0.530403s user + 0.000000s system = 0.530403s CPU (99.0%)
Lua calls C++ add_times() once:
0.000005s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%)