项目作者: jinq0123

项目描述 :
Timer calls between C++ and Lua with LuaIntf
高级语言: C++
项目地址: git://github.com/jinq0123/TimerLuaIntf.git
创建时间: 2017-08-30T08:26:05Z
项目社区:https://github.com/jinq0123/TimerLuaIntf

开源协议:MIT License

下载


TimerLuaIntf

Timer calls between C++ and Lua with LuaIntf.

Just a test.

Conclusion

  • Lua is fast.
  • LuaIntf is good.
  • Call from Lua to C++ is faster than from C++ to Lua.

Build

  1. Install conan.
  2. conan remote add remote_bintray_jinq0123 https://api.bintray.com/conan/jinq0123/test
  3. conan install --build missing
    1. PROJECT: Generator visual_studio created conanbuildinfo.props
    2. PROJECT: Generated conaninfo.txt
  4. Use sln to build. Select Release config.

Output

  1. C++ calls lua add() many times:
  2. 2.759473s wall, 2.761218s user + 0.000000s system = 2.761218s CPU (100.1%)
  3. C++ calls lua add_times() once:
  4. 0.436400s wall, 0.436803s user + 0.000000s system = 0.436803s CPU (100.1%)
  5. Lua calls C++ add() many times:
  6. 0.535802s wall, 0.530403s user + 0.000000s system = 0.530403s CPU (99.0%)
  7. Lua calls C++ add_times() once:
  8. 0.000005s wall, 0.000000s user + 0.000000s system = 0.000000s CPU (n/a%)

Reference