ThePhD / sol2

Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
http://sol2.rtfd.io/
MIT License
4.2k stars 516 forks source link

Performance of lua calling C + + sol function #1401

Open w4454962 opened 2 years ago

w4454962 commented 2 years ago

xx1 xx2

Type checking is not enabled, but why does the number of parameters increase and the running time double

w4454962 commented 2 years ago

If "lua_tointeger" is used to increase parameters, the runtime will not be increased, and it is fixed at 0.2S

w4454962 commented 2 years ago

I found that after changing int to float, it was normal. Maybe I used luajit, and sol would have more float2int behavior. Even if luajit provided "lua_tointeger", sol would not use it directly