Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何使用静态绑定+代码生成提高 c++ lua 调用效率 #675

Open
ZichaoNickFox opened this issue Nov 15, 2023 · 0 comments
Open

Comments

@ZichaoNickFox
Copy link

ZichaoNickFox commented Nov 15, 2023

您好,目前我们项目使用 unlua 的动态绑定机制,将 lua 中对象的函数回调给 Class_Index,再 GetCppInstance 得到 userdata,再用反射处理对象的 Property。这种方式在 UnrealInsights 中看到在 lua 调用 c++ 时速度比较慢。

请问可否将函数、属性的 set get 方法的 cfunction 直接注册到对象元表中对应方法中,这样调用 lua 方法时,将直接回调给 c++ 的每个函数或属性的 set get 函数。请问这个方式可否较大程度提高效率?

上述方式需要大量的胶水代码,请问是否有生成静态绑定的胶水代码的导出工具?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant