Skip to content

jinq0123/TimerLuaIntf

Repository files navigation

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
    PROJECT: Generator visual_studio created conanbuildinfo.props
    PROJECT: Generated conaninfo.txt
    
  4. Use sln to build. Select Release config.

Output

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%)

Reference

About

Timer calls between C++ and Lua with LuaIntf

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published